Browser's back and forward buttons
-
Can I programatically control the browser's navigation buttons in my code? For instance, the user can navigate to several diferrent pages in my web application, but whenever he hits the "Back" button in IE, it always brings him back to the main page. The reason I want to do this is the following. Lets say that the user clicks on a link to go to a form from my main page. He fills out the form and clicks "Submit". My code then clears the textboxs. Now when the user clicks "Back" on the browser, the textboxes become refilled with stuff that he just typed in. I dont not want this. I want him to be taken straight back to the main page when he clicks "Back" in IE. So is there a way to control the browser's navigational buttons in my C# code? (or in javascript)?
-
Can I programatically control the browser's navigation buttons in my code? For instance, the user can navigate to several diferrent pages in my web application, but whenever he hits the "Back" button in IE, it always brings him back to the main page. The reason I want to do this is the following. Lets say that the user clicks on a link to go to a form from my main page. He fills out the form and clicks "Submit". My code then clears the textboxs. Now when the user clicks "Back" on the browser, the textboxes become refilled with stuff that he just typed in. I dont not want this. I want him to be taken straight back to the main page when he clicks "Back" in IE. So is there a way to control the browser's navigational buttons in my C# code? (or in javascript)?
I don't know a way of writing to the browsers history, or preventing the use of the browser's Back and Forward buttons (apart from launching your site in a browser configured with no button bar), but... You could circumvent this problem by: Instead of submitting the form, copy the values to a form in a hidden frame and submit that instead, or... Replace standard navigation by use of the Javascript "location.replace();" function, which permits multiple pages to be loaded, without adding them to the browser's history. Hope this helps, Jon.;)
-
Can I programatically control the browser's navigation buttons in my code? For instance, the user can navigate to several diferrent pages in my web application, but whenever he hits the "Back" button in IE, it always brings him back to the main page. The reason I want to do this is the following. Lets say that the user clicks on a link to go to a form from my main page. He fills out the form and clicks "Submit". My code then clears the textboxs. Now when the user clicks "Back" on the browser, the textboxes become refilled with stuff that he just typed in. I dont not want this. I want him to be taken straight back to the main page when he clicks "Back" in IE. So is there a way to control the browser's navigational buttons in my C# code? (or in javascript)?
Not possible.
$TeVe McLeNiThAn
-
Can I programatically control the browser's navigation buttons in my code? For instance, the user can navigate to several diferrent pages in my web application, but whenever he hits the "Back" button in IE, it always brings him back to the main page. The reason I want to do this is the following. Lets say that the user clicks on a link to go to a form from my main page. He fills out the form and clicks "Submit". My code then clears the textboxs. Now when the user clicks "Back" on the browser, the textboxes become refilled with stuff that he just typed in. I dont not want this. I want him to be taken straight back to the main page when he clicks "Back" in IE. So is there a way to control the browser's navigational buttons in my C# code? (or in javascript)?
Yep! Of course, but not in C#, perhaps you may use it from JavaScript. I think history.forward() would null back button and forward button effects. To null the effects of ALT +(UP/Dn) arrows, backspace key, you can try and use document.onkeydown = function { //check for keycode of the above key and null the event.keyCode to zero. } Deepak Kumar Vasudevan http://deepak.portland.co.uk/