Anthony

I presume you're trying to disable the button so a user cannot click twice.

This methodology has been discussed previously and, assuming that's the case, 
you're looking at the problem the wrong way around.  This is similar to the 
'how do I disable the back button' question.

What do you do if there's a s script error or network glitch during the POST.  
The user is stuck.

Let the user click as many times as they want or go back and forth - just make 
sure you process the request once.  Do this by inserting a nonce into the form 
as a hidden item and store it in the DB or session state. When you've processed 
it, mark it as such and move the user on - a GUID is often used for this 
purpose.

Job done!  No jiggery-pokery on the client side where you have less control.

Good luck, and do let us know the site you're working on if it goes public.

--
Richard Carde

On 19 Apr 2011, at 03:28, "Anthony" <asale...@tpg.com.au> wrote:

> I want add the following to all button on my website  i.e. 
> button.Attributes.Add("onclick", 
> ClientScript.GetPostBackEventReference(button, "") + ";this.value='Processing 
> Credit Card Payment...';this.disabled = true;")
>  
> 
> Is there an easy to automatically apply this to all buttons?
> 
>  
> 
> regards
> 
> Anthony (*12QWERNB*)
> 
>  
> 
>  

Reply via email to