An ASP.NET Blog
I work for Microsoft and help people and businesses make better use of technolgy to realize their full potential. The opinions mentioned herein are solely mine and do not reflect those of my employer.

A better way of working with IE Webcontrol - TabStrip Control

Saturday, October 15, 2005 8:10 AM
IE Webcontrols are very useful in accomplishing rich user experience for your web applications with the controls like TreeView, TabStrip, MultiPage etc., which are not shipped out of the box with ASP.NET 1.x Versions.

One of the commonly used IE Webcontrol is the TabStrip control. TabStrip control is mostly used in combination with MultiPage control.

TabStrip provides you with Tab Control for your ASP.NET Page through which you can implemented a Tabbed User Interface of Menu, Options etc.,

When we combine MultiPage with TabStrip control, we can show different portions of the Page based on the Tab selected.

This would give a wizard sort of look and feel for your pages where users see different parts of the page on clicking different tabs.

One common practice while implementing TabStrip control is to set the AutoPostBack property to True. This way we will be forcing a page refresh when a different Tab is selected. On this event, we populate, initialize the MultiPage associated with the Tab that is selected.

The fact to be noted is that, though while development, the Server lies in your local machine and the PostBack is not noticably slow, in real world scenarios, the postback may take quite some time before showing the other MultiPage.

This causes not only an irritating flashing of the page but the selected tab takes sometime to complete the events associated with it and gives an ugly look and feel until it is fully loaded.

A better way to handle this is to load, initialize all the multipages in the Page_Load or any other single event (DropDown selection etc.,) and then make it available for switching between tabs. You need to set the AutoPostBack property to false to avoid the PostBack.

If we load and intialize all the MultiPages in one single event, though it takes a little time initially to complete, later it provides a rich look and feel by avoiding a PostBack and ugly flashing of page everytime the Tab selected is changed.

Also, by this way you can also preserve the Controls' state across Tab switches. When you disable autopostback, you can notice that though you switch between the tabs, the controls in each tab dont lose their state. On the contrary if you have autopostback to true, you will be populating / initializing them on each postback and hence they may lose their state.

Thus, we can have a better way of displaying contents with IE Tabstrip webcontrol.

This article holds good only for ASP.NET 1.x versions since with ASP.NET 2.0 (scheduled to release this year), there are better controls than IE Webcontrols.

Cheers and Happy Programming !!!

Feedback

# re: A better way of working with IE Webcontrol - TabStrip Control

how can i select each page if postback is false 12/16/2005 7:51 PM | Richard

# re: A better way of working with IE Webcontrol - TabStrip Control

Hi,

When AutoPostBack is false, it will still pick up the MultiPage specified for that Tab. The functionality doesnt change based on Postback. 12/19/2005 3:15 AM | Harish Ranganathan

# re: A better way of working with IE Webcontrol - TabStrip Control

What is a better Tab control in asp 2.0? 1/3/2006 4:51 PM | jeff

# re: A better way of working with IE Webcontrol - TabStrip Control

wich controls are better than ie webcontrols? 2/13/2006 5:59 PM | mark

# re: A better way of working with IE Webcontrol - TabStrip Control

what if you have a single page with a grid, and all the time you refresh it and bind it with some other data, then how do you avoid the flashing. 2/20/2006 8:26 AM | Swapneel Talera

# re: A better way of working with IE Webcontrol - TabStrip Control

I have the tabstrip control which is working in localhost but not working when i moved to other environment which has .net 1.1 framework installed with having the reference of Microsoft.Web.UI.WebControls in bin. What may the reason 2/7/2007 11:30 AM | Jyothi

Post a comment





 

Please add 6 and 6 and type the answer here: