Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • MultiView in Asp.NET and how is it different from Panel control

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.98k
    Comment on it

    "MultiView in Asp.NET and how is it different from Panel control"

        MultiView control is a asp.net web server control, used to create multiple views of a single page.It helps not to create multiple pages for making different interfaces. Using MultiView we can create multiple views in a single page, and can switch between them easily as per the requirement.

    Using MultiView:

    <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
    <asp:View ID="View1" runat="server">
    
       </asp:View>
    <asp:View ID="View2" runat="server">
    
       </asp:View>
    </asp:MultiView>
    

     Inside the MultiView we can declare various View controls as required. The ActiveViewIndex="0" property of the MultiView specifies that by default the first view will be active, and rest will be hidden. We write different HTMLs inside each view so as to create different interfaces. From code behind we manage the visibility of the view as per the requirement by the following syntax:

     MultiView1.ActiveViewIndex = 2;
    

    This specifies that View on index 2 will get active and rest will be hidden. But creating to much views makes it complex.

    MultiView looks same as the Panel control but with little differences:

    1.Panel control is mostly single Panel display and is at time multiple Panel display.

    Whereas

    MultiView control is mostly multiple View display and is at single View display.

    2. The Panel control is mostly used to display or hide groups of controls.

    Whereas

    MultiView control is mostly used to display content that can be anything.Simple plain text, image,etc.

    3. Panel controls are made active or visible as follows:

    Panel1.Visible=true;
    

    Whereas

    In MultiView control Views are made active as follows:

    MultiView1.ActiveViewIndex = 2;
    

 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: