
June 14th, 2006, 03:43 PM
|
|
Wrox Author
Points: 12,827, Level: 49 |
|
|
Join Date: Oct 2005
Location: Akron, Ohio, USA.
Posts: 4,029
Thanks: 1
Thanked 42 Times in 42 Posts
|
|
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."
|