简体   繁体   中英

Validating a textbox with AJAX Toolkit in ASP.NET

I'm not really sure where or what to search for regarding the following question:

I have a TextBox control and a Label control on my page. I have a database query ready and I would like to run it on the TextBox textchanged event in order to display a "valid" or "not valid" text in the Label.

How can I achieve this without posting back the entire page on each textchanged event? I have installed the AJAX Control Toolkit and got the samples working but I don't seem to find an extender that would fit the bill. Any tips? Much appreciated, thank you.

Firstly, move away from the AjaxControlToolkit. This is for lazy web developers who dont know what they are doing.

Secondly, check out jQuery Ajax. Learn how to use it properly in order to do what you are needing to do.

Basically what you will need to do is post via jQuery Ajax to your page/webservice in order to run the database query. You can then return your data to the page and update the UI.

http://api.jquery.com/jQuery.ajax/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM