Tabs for ASP.NET Website

I would like to add tabs for my website, and I understand that I can use the tab control in the AJAX toolkit, or I can select the tabs of JQuery UI. Each tab will have to load a separate asp.net page, and I need to configure the tabs to look slippery.

Any thoughts on which approach I can use?

+4
source share
4 answers

There is a 1001 way to execute behavior ...

you can even go with jQuery Tools and asynchronously load each tab from every page

can you talk in more detail about what kind of problem, since your question is unclear ...

+4
source

JQuery tabs are designed to simplify clean client and AJAX tabs as much as possible. Your requirements are for each tab to go to a separate web page. In this case, this may be the wrong approach.

Since each tab will be a different ASP.NET page, you will need something that is easy to configure on the server side so that 1) the tab control can be reused; 2) it is easy to indicate which tab is β€œopen” on the server side. I suspect that ASP.NET AJAX will be simpler in both ways.

And again, my own experience was with RadControls' RadTabStrip . If you need to spend a few dollars, you can get a great set of reusable widgets from these guys, which are very customizable.

+3
source

Here you can see a demo of the AjaxControlToolkit tabs:

If you look below, you will see a section on its topic. You can completely change the layout to suit your needs.

As for loading individual pages on each tab, you need to clarify what you mean, as there are several options:

  • Place an iframe inside a tab that points to an external file
  • Pull the contents of another file using ajax and enter it on a tab (not directly supported by ajaxcontroltoolkit tabs).
  • User controls. You can create separate user controls for presenting pages. This will allow you to separate the functionality and develop it separately from the main page clutter.

If search engines can see and index the contents of these tabs, you should also indicate this, since not all of the above solutions are Google friendly (or accessible to blind users).

0
source

My question is that the contents of my tab pages are separate aspx pages, should I use jQuery tabs or tabs using ajax toolkit

Given that AjaxControltoolkit is actually not an option. AjaxControlToolkit tabs are controls, which means they must live inside the form on the server side. Even if you can force them to load the contents of another ASPX page, the most likely result of this will be nested html forms that are not actually supported.

If you go to the jQuery UI tabs tab, you are likely to run into various problems: page redirection on postback . You can try to work around this problem using jQuery Form (something like these lines ), but it may be difficult for you to work with controls that submit forms using the __ doPostBack method. If your ASPX pages rely on postbacks, the best option is to place an iframe for each tab and thus load aspx pages. This will allow your pages to continue to function properly with postbacks.

ASP.NET MVC is much better suited to the setup you are trying to achieve, if at all.

0
source

Source: https://habr.com/ru/post/1306527/


All Articles