Eng | Rus
 
Education -> Solutions -> Catch asp.net button click
 
 
 
Simple Seo Solutions
SEO and Promotion
sites
VoiceNotebook.com
Speech to text for AndroidAndroid speech to text

Catch asp.net button click event in javascript

Some time it is necessary to catch button click event before submit the page.
The code below change caption and disable next click event of the button.
Lets we have some Button with the name button1 and Text="Start" on the aspx page. Now we can insert in the page_load event (vb.net):
button.Attributes("onclick") = "if( getElementById('button1').value =='Start'){getElementById('button1').value ='Process started';return true;}else return false;"
So, the button caption will be changed immedeatly and next click event will be disabled.

© prjsoft.ru