Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable/Enable ASP.net button when clicked using AJAX

Status
Not open for further replies.
Apr 11, 2002
193
IN
Hi,

I am using ASP.net 2.0 and Ajax Extensions 1.0. I have got some controls on the page and a search button(asp.net button). When i click the search button i make a call to a web service which gets me the data. What i want to do is to disable the search button till i get the data and then enable it again.

Thanks,
Manish
 
You can do this in javascript from the OnClientClick event e.g.
Code:
OnClientClick="this.disabled=true;"
You then just have to register some javascript when the call finished to re-enable the button.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 
Hi Mark,

I tried your suggestion and when i click on the button it makes it disable but the click event of the buttons doesnt get fired and the button is disabled forever.

Thanks,
Manish
 
Try adding this attribute to your button:

UseSubmitBehavior="false
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top