Disabling asp:button after submitted or pressed
-
I've been searching everywhere for a way to disable a push button as soon as it's pressed. I really don't want to have to use Javascript to do this and would rather write straight up VB.NET to handle this request. Basically you have a button: when the person clicks on that I want to disable the button, the code should do the following: pushbutton.enabled=false pushbutton.text="wait" But for some reason (server-side script, I know) .NET won't re-render this. I want to make sure NO ONE can hit a submit button twice. Anyone have a solution to this? I'm open to all suggestions. Thank you, Jordan
-
I've been searching everywhere for a way to disable a push button as soon as it's pressed. I really don't want to have to use Javascript to do this and would rather write straight up VB.NET to handle this request. Basically you have a button: when the person clicks on that I want to disable the button, the code should do the following: pushbutton.enabled=false pushbutton.text="wait" But for some reason (server-side script, I know) .NET won't re-render this. I want to make sure NO ONE can hit a submit button twice. Anyone have a solution to this? I'm open to all suggestions. Thank you, Jordan
Hi, you can look at similar control here: http://www.codeproject.com/aspnet/PleaseWaitButton.asp[^]. I'm not sure if it will be usefull for you, but at least you can see how to create control with similar functionality.
Tomáš Petříček (Microsoft C# MVP)
www.eeeksoft.net | Asp.Net Graphical controls -
I've been searching everywhere for a way to disable a push button as soon as it's pressed. I really don't want to have to use Javascript to do this and would rather write straight up VB.NET to handle this request. Basically you have a button: when the person clicks on that I want to disable the button, the code should do the following: pushbutton.enabled=false pushbutton.text="wait" But for some reason (server-side script, I know) .NET won't re-render this. I want to make sure NO ONE can hit a submit button twice. Anyone have a solution to this? I'm open to all suggestions. Thank you, Jordan
have a viewstate variable for the postback!! that is have a viewstate inside the if(!isPostBack) and have it false then if the button is pressed then make it as true and if the viewstate value is true then disable it! i hope this may work!! not tried!!;):) Loving Code, R. Senthil Kumaran