disabling back button,
-
Hi i am doing an web application , in which i have to disable the back button using the C# code. can you please help me?? else, can any one tell some coding in the asp side so that i can paste directly in the page??
-
Hi i am doing an web application , in which i have to disable the back button using the C# code. can you please help me?? else, can any one tell some coding in the asp side so that i can paste directly in the page??
You may have to solve this with some Javascript, so that you can trap the user when they press the Backspace Key on the keyboard.
function fOnKeypress() {
try {
var charCode = window.event.keyCode; if (charCode == 13) { window.event.keyCode= 9; }
}
catch (er) {
//alert('fOnKeypress ' + er);
}
}You will need to load this in the BODY OnLoad event. I'm usign something like this:
var objForm= document.getElementById("aspnetForm"); // There should be a better way to get the name of the form instead of hard-coding it like this.
objForm.onkeydown=fOnKeypress; -
Hi i am doing an web application , in which i have to disable the back button using the C# code. can you please help me?? else, can any one tell some coding in the asp side so that i can paste directly in the page??
Very easy to enable or disable a button through C#. If your page has the following button:
<asp:Button ID="Button1" runat="server" Text="Click me" onclick="Button1_Click" />
Then you can enable/disable it in your code-behind file through setting its 'enabled' property:
Button1.Enabled = false;
orButton1.Enabled = true
Hope this helps! :) FraukeFrauke Nonnenmacher Creative Cats
-
Hi i am doing an web application , in which i have to disable the back button using the C# code. can you please help me?? else, can any one tell some coding in the asp side so that i can paste directly in the page??
Hope you are talking about the browser back button. You cannot disable the back button if the browser instance is opened and your URL is typed in the address bar. However you have control over the window which you are opening from your code. So the only way to solve your problem is to have a default startup page in which you have to do a opendialog for your homepage and pass the arguments disbaling the menu bars and titlebars.
-
Hope you are talking about the browser back button. You cannot disable the back button if the browser instance is opened and your URL is typed in the address bar. However you have control over the window which you are opening from your code. So the only way to solve your problem is to have a default startup page in which you have to do a opendialog for your homepage and pass the arguments disbaling the menu bars and titlebars.
mr sundar, its ok , i understand and know what you are telling. thanks for replying. but the scenario here is, i am calling this page from a third party say like pay pal(after success full trans). in this case how can i give those things like disabling browsing button and all, can u please rpely
-
mr sundar, its ok , i understand and know what you are telling. thanks for replying. but the scenario here is, i am calling this page from a third party say like pay pal(after success full trans). in this case how can i give those things like disabling browsing button and all, can u please rpely