A better way of working with IE Webcontrol - TabStrip Control

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 !!!

Print | posted on Saturday, October 15, 2005 8:10 AM

Comments on this post

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

Requesting Gravatar...
how can i select each page if postback is false
Left by Richard on Dec 16, 2005 7:51 PM

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

Requesting Gravatar...
Hi,

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

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

Requesting Gravatar...
wich controls are better than ie webcontrols?
Left by mark on Feb 13, 2006 5:59 PM

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

Requesting Gravatar...
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.
Left by Swapneel Talera on Feb 20, 2006 8:26 AM

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

Requesting Gravatar...
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
Left by Jyothi on Feb 07, 2007 11:30 AM

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

Requesting Gravatar...
all the time you refresh it and bind it with some other data, then how do you avoid the flashing.
Left by mario oyunları on Sep 21, 2009 10:40 AM

Your comment:

 (will show your gravatar)