I have a ASP.NET website and say it has 2 pages. I am displaying these 2 pages as 2 tabs. Both pages have some input fields like check boxes, radio buttons, dropdowns.
When I move from tab-1 to tab-2, I have to perform the following operations.
-
I need to save the data entered on tab-1. This is currently handled in tab-1’s PageLoad when user clicks tab-2 on the screen. I have made a DataSave() method, which is called in the PageLoad for IsPagePostBack equals true.
-
Once the DataSave is completed, I exit from tab-1 page and call the PageLoad of tab-2.
-
In tab-2, I created a DataLoad() method, which brings all the data for controls on tab-2.
-
Now when I enter all the data on tab-2 and click tab-1, the same steps 1 to step 3 are completed for tab-2 and tab-1.
This process takes a lot of time. The user is shown saving of first tab and then loading of second tab everytime.
Is there a way, that I can load the controls of second tab (or as many secondary tabs I have) in the background when the user is working on tab-1. And when the user clicks the second tab, he is displayed the second tab instantly while the tab-1 data is saved in the background.
I hope I was able to explain my problem.
My answer is contingent on the data on both pages not becoming huge because then you could hamstring one tab at the expense of the other… But what you could do to get this affect is load tab 1 and tab 2 on the same page. However, load only the data for tab 1 on page load and load the data for tab 2 async w/ ajax or something. That way, Tab 1 SHOULD load just as quickly as ever, but tab 2 would load behind the scenes, such that when the user changed tabs, the data would be there and it would feel almost instantaneous…
I get that I haven’t provided a code sample… I can give you some ideas, but I would probably use jquery’s ajax functions to load the data on tab 2…