View Single Post
  #2 (permalink)  
Old June 14th, 2006, 03:43 PM
dparsons dparsons is offline
Wrox Author
Points: 12,827, Level: 49
Points: 12,827, Level: 49 Points: 12,827, Level: 49 Points: 12,827, Level: 49
Activity: 15%
Activity: 15% Activity: 15% Activity: 15%
 
Join Date: Oct 2005
Location: Akron, Ohio, USA.
Posts: 4,029
Thanks: 1
Thanked 42 Times in 42 Posts
Send a message via AIM to dparsons
Default

This is generally what you are trying to do:

            strJavaScript.Append("if (typeof(Page_ClientValidate) == 'function') { ")
            strJavaScript.Append("if (Page_ClientValidate() == false) { return false; }} ")
            strJavaScript.Append("this.value = 'Please wait...';")
            strJavaScript.Append("this.disabled = true;")
            strJavaScript.Append(Page.GetPostBackEventReferenc e(Me.btnSubmit))
            strJavaScript.Append(";")
            btnSubmit.Attributes.Add("onClick", strJavaScript.ToString)

This javascript is added to a button and it disables the button on the client side and calls the btnSubmit_click() event in my code behind when a user clicks it. You get the general idea and should be able to make it work with your application.

"The one language all programmers understand is profanity."
Reply With Quote