I would like to have a webpage something like windows tab control.
Each webpage does not lose the contents and data while moving between pages, postbacks, etc.
Here is the website design and my idea:
[Master Page]
"Fruits" "Cars" "Animals" "Operators"
- clicking on “Fruits” will forwards to “Fruits” page, and the same for other links (tabs)
- The user works on “Fruits” page searching fruits, fill up some fields, etc.
- The user then moves to “Cars” page and then builds up his own car by filling some fields, etc
- and then the user goes back to “Fruits” page again -> the user sees the same page where she/he left on “Fruits” page.
Please suggest some good ways other than using javascript:history.go(-1).
Is this possible to implement?
It is most definitely possible, a very simple solution would be to have 4 divs and hide/show the div corresponding to the the link the user clicks “eg: Fruits link will show the fruits div” this sort of plumbing is already with most JavaScript libraries, a good one is the Jquery UI framework, the tab control would achieve what you want to do
Look at the jQuery demos and documentation it makes it very easy to have client side tabs via ajax.
http://jqueryui.com/demos/tabs/
http://www.randomsnippets.com/2011/04/10/how-to-hide-show-or-toggle-your-div-with-jquery/
If using a 3party javascript library is not an option for you, then there is always the plain old javascript way of showing/hiding div’s
http://webdesign.about.com/od/dhtml/a/aa101507.htm