Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • Using tabbed controls in .NET

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 45
    Comment on it

    While designing applications in .NET sometimes you need to mention the UI in a single page such that they appear one by one not at a single go.

    For doing that you need to use the tab control provided by .NET framework.

    We have multiview controls in .NET

    <asp:MultView ID= "MultiView1" runat= "server">
    </asp:MultiView>

    For providing tabbing inside we need to define views inside it.

    <asp:MultView ID= "MultiView1" runat= "server">
       <asp:View ID= "View1" runat= "server"> </asp:View>
    </asp:MultiView>

    You can create any number of view you want depending upon the number of tabs you want to show in your application.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="multiviewdemo._Default" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    
       <head runat="server">
          <title>
             Untitled Page
          </title>
       </head>
       
       <body>
          <form id="form1" runat="server">
          
             <div>
                <h2>MultiView and View Controls</h2>
                
                <asp:DropDownList ID="DropDownList1" runat="server" onselectedindexchanged="DropDownList1_SelectedIndexChanged">
                </asp:DropDownList>
                
                <hr />
                
                <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="2"  onactiveviewchanged="MultiView1_ActiveViewChanged" >
                   <asp:View ID="View1" runat="server">
                      <h3>This is view 1</h3>
                      <br />
                      <asp:Button CommandName="NextView" ID="btnnext1" runat="server" Text = "Go To Next" />
                      <asp:Button CommandArgument="View3" CommandName="SwitchViewByID" ID="btnlast" runat="server" Text  ="Go To Last" />
                   </asp:View> 
    					
                   <asp:View ID="View2" runat="server">
                      <h3>This is view 2</h3>
                      <asp:Button CommandName="NextView" ID="btnnext2" runat="server" Text = "Go To Next" />
                      <asp:Button CommandName="PrevView" ID="btnprevious2" runat="server" Text = "Go To Previous View" />
                   </asp:View> 
    
                   <asp:View ID="View3" runat="server">
                      <h3> This is view 3</h3>
                      <br />
                      <asp:Calendar ID="Calender1" runat="server"></asp:Calendar>
                      <br />
                      <asp:Button  CommandArgument="0" CommandName="SwitchViewByIndex" ID="btnfirst"   runat="server" Text = "Go To Next" />
                      <asp:Button CommandName="PrevView" ID="btnprevious" runat="server" Text = "Go To Previous View" />
                   </asp:View> 
                   
                </asp:MultiView>
             </div>
             
          </form>
       </body>
    </html>

     

    .net

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: