Sunday, August 18, 2013

MultiView in Asp.net


Code:   


       MultiView1.ActiveViewIndex = 0;



MultiView1.ActiveViewIndex = 1;


.aspx 

<asp:MultiView ID="MultiView1" runat="server">
                    <asp:View ID="CourseDetails" runat="server" >
                        <table class="style1">
                            <tr>
                                <td class="style2">
                                    Course</td>
                                <td>
                                    <asp:TextBox ID="txtCourse" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style2">
                                    Fees</td>
                                <td>
                                    <asp:TextBox ID="txtFees" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style2">
                                    Duration</td>
                                <td>
                                    <asp:TextBox ID="txtDuration" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style2">
                                    &nbsp;</td>
                                <td>
                                    <asp:Button ID="btnSave" runat="server" Text="Save" onclick="btnSave_Click" />
                                </td>
                            </tr>
                        </table>
                    </asp:View>
                    <asp:View ID="BookDetails" runat="server">
                        <table class="style1">
                            <tr>
                                <td class="style2">
                                    BookName</td>
                                <td>
                                    <asp:TextBox ID="txtBook" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style2">
                                    Auother</td>
                                <td>
                                    <asp:TextBox ID="txtAuthor" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style2">
                                    Price</td>
                                <td>
                                    <asp:TextBox ID="txtPrice" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style2">
                                    &nbsp;</td>
                                <td>
                                    <asp:Button ID="btnAdd" runat="server" Text="Add" />
                                </td>
                            </tr>
                        </table>
                    </asp:View>
                    <asp:View ID="StudentsDetails" runat="server">
                        <table class="style1">
                            <tr>
                                <td class="style2">
                                    RegNo</td>
                                <td>
                                    <asp:TextBox ID="txtReg" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style2">
                                    Name</td>
                                <td>
                                    <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style2">
                                    Branch</td>
                                <td>
                                    <asp:DropDownList ID="ddlBranch" runat="server" Height="16px" Width="128px">
                                        <asp:ListItem>--select--</asp:ListItem>
                                        <asp:ListItem>CS</asp:ListItem>
                                        <asp:ListItem>EC</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="style2">
                                    &nbsp;</td>
                                <td>
                                    <asp:Button ID="btnUpdate" runat="server" Text="Update" />
                                </td>
                            </tr>
                        </table>
                    </asp:View>
                </asp:MultiView>

No comments:

Post a Comment