Saturday, April 11, 2009

Implementing Tabs using MultiView Control : ASP.NET

Using MultiView control in ASP.NET we can achieve tabs in a web page, now in this example I am going to explain how we can create tabs using MulitView control

Create a web application and add a Table control with 1 row and 3 columns and a MultiView control with 3 views, you can refer below screen shot

Here we are adding 3 cells using table control and each cell will have a link button which acts as Tab

image

We need to set ActiveViewIndex property of a MultiView control to see particular tab for that initially in Page_Load we set ActiveViewIndex to 0 and on clicking every link we will call TabChange event to show the particular tab, in the below code we identify which link button is clicked and based that we will change the ActiveViewIndex to show the contents

image

Now we are ready with out code, just build, run and test

Hope this helps

Tags : Tab control in ASP.NET, MulitView control, Satish Kumar J

1 comment:

  1. This was very helpful and easy to understand :D
    Thanks to you and .NET

    ReplyDelete