views:

34

answers:

2

I'm considering if it is a good idea to use an ASP.Net TabContainer-Control in the way that every TabPanel contains content of a different page. For example: Next i want to implement in my application is the masterdata management. Normally i would create one aspx page for every masterdata-table (f.e. Customer -> MD_Customer.aspx). Then i would add a link into my Menu to this page. Now i'm thinking of creating one aspx page for all(Masterdata.aspx) with a Tabcontainer and an UpdatePanel for every type of Masterdata. The link it the menu could have an additional MDType as URL-Parameter. My main concerns are related to performance(one "page" for every TabPanel currently means 7 "pages" in one) and maintainability because of increasing complexity.

Is it a good approach or a bad idea?

Thanks

+1  A: 

I don't know ASP.Net, but one way to handle the extra complexity of tabs in WinForm apps is to make the contents of each tab page be a separate user control, and then the main form just have to deal with the tab control itself and showing the correct user control.
I think ASP.Net have user controls, so you could possibly do something similar.

ho1
A ASP.Net TabContainer's TabPanel is already like an UserControl, because its content is only be loaded when the Panel is Enabled.I think putting all in one UserControl thats dynamically loaded when a TabPanel will be enabled makes it more complicated. Thanks anyway.
Tim Schmelter
@Tim: I don't know about the loading, but the reason for making it into a user control would be to separate the code so that you don't end up with one gigantic page that have to handle lots of controls, rather each user control would have the code for handling all the controls it contains.
ho1
I'm still not convinced from the UserControl approach because i've made bad experiences with putting to much logic into one UserControl. They wouldnt be reusable at all and only be an alternate for a page. So i would get the complexity and pitfalls of an userControl(events/page life cycle) without(?) any appreciable advantage.
Tim Schmelter
@Tim: Probably half of the user controls I make are not reused, they're just to split out the code (I have form from hell that was over 7000 lines of code to handle about 100 controls that I needed to add a lot more functionality to, so I tried to extract stuff to user controls and the file is now a lot smaller even though it has more functionality). As I said though, this is WinForms experience, so not sure if it's relevant for you.
ho1
Ok, i will give it a try. But I'm waiting for some experienced asp.net ajax developers to take away my concerns related to performance and maintainability ;-)
Tim Schmelter
@Tim: You might want to try to add more info to or edit your question in some way, I think that might bump the question a bit.
ho1
+1  A: 

Like ho1 said you definitely need to make the content of each tab a user control.

As you already pointed out, performance wise this is going to suck. To overcome this you could lazy load the user controls in the tabs.

The content of each tab will only be loaded when its the enabled tab, isnt it?? Then it would be no difference when using usercontrols but only makes it more complicated.
Tim Schmelter
What means lazy load in this context? Arent the TabPanels only loaded when active/enabled?
Tim Schmelter
Is this what you meant? http://mattberseth.com/blog/2007/07/how_to_lazyload_tabpanels_with.html
Tim Schmelter
Exactly. Perfectly fits your requirements.