Click here to Skip to main content
11,924,469 members (58,820 online)
Click here to Skip to main content
Add your own
alternative version


19 bookmarked

How to use Multiview Control in ASP.NET

, 23 Jul 2007
Rate this:
Please Sign up or sign in to vote.
The article describes how to use the Multiview server control in
Screenshot - MVC.jpg


This article describes how to use the multiview server control in with c# as the backend


The multiview control is a new feature of 2.0 which was introduced with visualstudio 2005.The main advantage of the multiview control is tnat we can specify the required view only(Ie display the required view only) on a single page.Multiview control helps us to create different views in the same page and display the view as the user clicks the links. With Multiview control the tab functionality is achived in

Using the code


<table border="0" cellpadding="2" cellspacing="3" width="100%">

<asp:LinkButton ID="lnkTab1" runat="server" OnClick="lnkTab1_Click">Tab1</asp:LinkButton></td>
<asp:LinkButton ID="lnkTab2" runat="server" OnClick="lnkTab2_Click">Tab2</asp:LinkButton></td>
<asp:LinkButton ID="lnkTab3" runat="server" OnClick="lnkTab3_Click">Tab3</asp:LinkButton></td>
<td colspan="3">
<asp:MultiView ID="MultiView1" runat="server">
<table width="100%" cellpadding="2" cellspacing="5">
<asp:View ID="View1" runat="server">
Content 1 goes here</asp:View>
<asp:View ID="View2" runat="server">
Content 2 goes here</asp:View>
<asp:View ID="View3" runat="server">
content 3 goes here</asp:View>

C# code

protected void Page_Load(object sender, EventArgs e)
  if (!IsPostBack)


private void SetDefaultView()
MultiView1.ActiveViewIndex = 0; 

protected void lnkTab1_Click(object sender, EventArgs e)
MultiView1.ActiveViewIndex = 0; 
protected void lnkTab2_Click(object sender, EventArgs e)
MultiView1.ActiveViewIndex = 1; 
protected void lnkTab3_Click(object sender, EventArgs e)
MultiView1.ActiveViewIndex = 2;

Points of Interest

This is a cool new feature of ASP.NET 2.0,Try this.


Created by George Zacharia on 23/07/2007 .


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

George Zacharia
Web Developer
India India
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralMy vote of 1 Pin
Reonekot10-Feb-14 23:50
memberReonekot10-Feb-14 23:50 
SuggestionMulti view pointer Pin
Kanzz_25413-Jun-13 3:56
memberKanzz_25413-Jun-13 3:56 
GeneralMy vote of 5 Pin
Member 94272117-Jun-13 4:42
memberMember 94272117-Jun-13 4:42 
GeneralNice Explain Pin
SinghAnuj5-Apr-13 20:53
memberSinghAnuj5-Apr-13 20:53 
QuestionMy Vote +5 Pin
Harshit Raj Singh15-Sep-12 9:01
memberHarshit Raj Singh15-Sep-12 9:01 
GeneralMy vote of 5 Pin
Prasad_Kulkarni14-Jun-12 1:31
memberPrasad_Kulkarni14-Jun-12 1:31 
GeneralMy vote of 1 Pin
ycano19-Jan-12 11:11
memberycano19-Jan-12 11:11 
Question???? Pin
Ravindra_Parcha14-Jan-12 9:05
memberRavindra_Parcha14-Jan-12 9:05 
Questionsub Pin
vinothharshad28-Jun-11 21:47
membervinothharshad28-Jun-11 21:47 
GeneralMy vote of 1 Pin
Milton_win18-Jun-09 22:52
memberMilton_win18-Jun-09 22:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.151125.3 | Last Updated 24 Jul 2007
Article Copyright 2007 by George Zacharia
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid