Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 20, 2012 09:02 AM by chikkanti
Mar 16, 2012 09:18 AM|LINK
I have my page where i have added back / next button in my page, to navigate back next, same as browser back next button, I have seen in browser if there no history of page, than browser back/next button is disabled, if forward history is not there than
next button is disabled, vice versa with back button, can i do same with my back next button used in my page, i am using same functionality as browser. Note i have mutliple pages in my site. so it should not stop other navigation.
Mar 16, 2012 09:45 AM|LINK
u cannot do it the way browser works.... i.e. you cannot determine if history.back is null or not...
u can check if history.length is 0... then u can disable both back and next buttons.... but, once user navigate for first time... history.length becomes more than 0... and then u can not determine whether u r back to first page or last... that means cannot
decide on whether back or next button should be disabled or not...
however, u can do history.back() or back button click and history.forward() on next button click... and if user is on first page... then clicking on back button will simply not work...
hope this helps...
Mar 19, 2012 03:11 AM|LINK
Please refer to detecting Browser back button
Based on this button's state you can set your button's visibility
Mar 20, 2012 04:09 AM|LINK
I don't want to detect browser back button, I have a page in which i have taken back and forward button
which have code, window.history.back() and window.history.forward()
when my page is loaded firsttime i want this buttons to be disabled, than when i do any action like drop down selection, back button should be enabled, now when back button is clicked next should be enabled.If there is no back than back should be disabled,
vice versa with forward button.
please help as this i main requirement of our project
Mar 20, 2012 05:00 AM|LINK
In stead of using window.history, you'll write your own data structure to save pages user has visited.
If it the first url, then disable the button.
Mar 20, 2012 09:02 AM|LINK
you can maintain history in viewstate and check for history
if u found any history in viewstate enable button
if u don't find any history disable...