Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tab Navigation - Frames or AJAX?

I have what I imagine to be a pretty standard web-interface.

There are 4 different ListViews (grid controls) which are accessed by a series of Tabs on the top.

I have implemented this as follows:

alt text http://img402.imageshack.us/img402/1530/pagedu8.jpg

Tab 1 will load Page 1 containing Grid 1 into Frame 2, Tab 2 will load Page 2 containing Grid 2 into Frame 2 etc.

However this then means that if you click on an item in the Grid, and I load DetailsPage1.aspx into Frame 2, then Frame 1 and the tabs are still visible and active.

I've been advised that I should just have one Frame, and load the Pages in dynamically based on the tab click, using HttpRequest (or WebRequest in asp.net).

Is this the correct approach to take? If you have any resources or tips at hand, it would be appreciated!

Thanks

like image 751
Duncan Avatar asked Jan 20 '26 02:01

Duncan


2 Answers

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.

like image 198
CJM Avatar answered Jan 22 '26 18:01

CJM


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

like image 30
Peter Parker Avatar answered Jan 22 '26 16:01

Peter Parker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!