Tab Navigation - Frames or AJAX?

Frames are an absolute no-no. There is no benefit to frames that can't be achieved using other techniques Does that mean you must use AJAX? Not necessarily.

AJAX is a perfectly good solution if you feel the need to provide a rich, seamless interface, but it's not strictly necessary You could use server-side includes to separate your tabs into a another (common) sub-page, but since you mention ASP. NET, (assuming you are running on framework v2 or greater) you might want to use Master Pages, where your tabs are in one content section or in the Master itself, and your grids/details are in another content section The key difference between the two techniques is that using AJAX, the transition from tab to tab will be slick and seamless, but a) it takes a little extra work (particularly if you are unfamiliar with any give AJAX framework) and b) since you essentially have 4 pages rolled into one, the pages are 'heavier' and are more complex to maintain. If you opt for the non-AJAX route, the key difference is that there will be a small but distinct refresh effect when you click on each tab (since it loads a new page each time) Of course, Master Pages are useful for maintaining a consistent site style and structure anyway, so there is no reason why you can't use AJAX with a Master Page system.

Frames are an absolute no-no. There is no benefit to frames that can't be achieved using other techniques. Does that mean you must use AJAX?

Not necessarily. AJAX is a perfectly good solution if you feel the need to provide a rich, seamless interface, but it's not strictly necessary. You could use server-side includes to separate your tabs into a another (common) sub-page, but since you mention ASP.NET, (assuming you are running on framework v2 or greater) you might want to use Master Pages, where your tabs are in one content section or in the Master itself, and your grids/details are in another content section.

The key difference between the two techniques is that using AJAX, the transition from tab to tab will be slick and seamless, but a) it takes a little extra work (particularly if you are unfamiliar with any give AJAX framework) and b) since you essentially have 4 pages rolled into one, the pages are 'heavier' and are more complex to maintain. If you opt for the non-AJAX route, the key difference is that there will be a small but distinct refresh effect when you click on each tab (since it loads a new page each time). Of course, Master Pages are useful for maintaining a consistent site style and structure anyway, so there is no reason why you can't use AJAX with a Master Page system.

I decided to go with Master Pages in the end - might as well take advantage of MS technology. Although sometimes I feel like I'm cheating when I do this! – Duncan Nov 2 '08 at 13:08 I disagree.

If you're working with ASP. NET, then iframes could be the best solution to display sub-forms with editable controls that require post-back event handling or ASP. NET features like view state encryption.

For example, my database documentation page has an animated menu, and when I click a table, view, or function name, it must load an ASPX sub-page that displays the object's properties (columns, parameters, etc. ) with editable description fields. Reloading a new page would disrupt the user experience, and using AJAX would complicate the content generation and post-back handling. – Triynko Jul 25 at 15:28.

Frames are lame: you will get problems, if users want to set a bookmark and if users visit your site via google: Then your navigational frame is not visible. So you need a lot of dirty javascript. To check this.

If you need javascript, do it right from the start and use AJAX.

Ajax is the best pick. But keep in mind to make it browse-able via back/forward. The best pick is to change page hash.

I used something like this: domain. Com/#tab1 for first tab domain. Com/#tab2 for second tab and so on.

If you use jQuery, this can be a good start (i use that and I had NO problem with). I'm sure there is a solution for all popular framework though :).

Instead of using frames, you should just include your navigation page in all of your other pages. The browser will see that you're including the same document in all of your pages and cache it.

Depending on what screens your users will see, if you load the detail views dynamically (Ajax or postback) you may have trouble persisting any information that the user has entered, and you will incur a wait (users don't like to wait).

I would recommend using jQuery and jQuery UI plugin. No frames will be needed, just div containers.

Like StingyJack, I would suggest having a look at the TabContainer control, but you might want to take care that your ViewState doesn't get too large if you do. So for example, don't load anything into a GridView until that Tab is being viewed and remove it contents if it is not (saving back to the database of course if required. Using the TabContainer's ActiveTabChanged event would be key to this strategy.

You diable ViewState for the grids but leave it on for the container.

Hmobius could you explain a little more, this could be really useful. In the ActiveTabChanged event how do you disable the ViewState on the grids? So for instance, if(tab.

Index == 1){//how to disable just gridview1's ViewState}? Thanks! – Sean Oct 31 '08 at 13:44 Each control in a tab has EnableViewState="false" then when activetabchanged is run, any core information (key values of anything selected, sort values etc) is saved to ViewState of the whoel control and any lsit items are removed from that before then populating the controls in the new one.

– Hmobius Nov 6 '08 at 13:05.

You're using ASP. NET, so just load all 4 controls into a mutliview and then on postback set the visible one to be which ever button has been clicked. msdn.microsoft.com/en-us/library/system.....

DO NOT uses frames (or iframes for that matter) unless you absolutely must... The only valid reasons I can think of to use (i)frames is file upload controls in fact, and I am not sure it's valid there either...

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions