Ajax自动填充 [英] Ajax Auto Fill

查看:190
本文介绍了Ajax自动填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网页中,我正在使用ajaxToolkit:AutoCompleteExtender填充文本框.

是否可以通过使用AJAX将AutoCompleteExtender文本框值作为参数来自动填充其他文本框?

例如,如果我在文本框中填写员工姓名",则相应的信息必须填写其他文本框,例如地址,电话号码等.

提前谢谢.

Nag

In my web page i am using ajaxToolkit:AutoCompleteExtender to fill the text box.

Is there any way to fill the other textboxes automatically by taking the AutoCompleteExtender textbox value as a paramter using AJAX?

For example, if i fill the EMPLOYEE NAME in the text box , the correpsonding information has to fill in the other textboxes, like address,phone number etc.

Thanks in advance.

Nag

推荐答案

dotnet.nag写道:
dotnet.nag wrote:

有什么方法可以填充通过使用AJAX将AutoCompleteExtender文本框值作为参数来自动创建其他文本框?

Is there any way to fill the other textboxes automatically by taking the AutoCompleteExtender textbox value as a paramter using AJAX?



是的!

将Javascript函数放在文本框onchange事件(或onblurr等-适合您的事件!)上.在这种情况下,创建XMLHttprequest,将文本框值作为参数传递,并获取所需的值并进行设置.



Yes!

Put a Javascript function on textbox onchange event(or onblurr, etc - event that suits you!). In the event, create an XMLHttprequest, pass the textbox value as paramter and get back the needed values and set it.


是对上述答案的改进..
将所有控件都放在更新面板中,这样您就不会再遇到回发了...

快乐编码:cool:
jst an improvement to the above answer..
keep all the controls in an update panel so that you cannot experience a postback too...

Happy Coding :cool:


这篇关于Ajax自动填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆