如何自动选择作为 AJAXContolToolkit 弹出控件一部分的文本框内的文本?
我构建了一个实现 AJAX 控件工具包 PopupControlExtender 的 ASP 用户控件。
它会弹出一个包含文本框和确定/取消按钮的 div。这个想法是,用户可以单击“重命名”图标,该图标会显示弹出窗口,其中显示一条消息“请输入新名称”,以及一个文本框,其中旧名称已填充并突出显示,以便当用户开始键入时,它会立即覆盖旧名称,或者用户可以简单地编辑现有名称。
我可以编写一些简单的 Javascript 来设置焦点并选择文本,但如何让它在显示弹出窗口时执行?该文本框在 AJAX 回调期间填充。
我的用户控件的代码非常大,因为它做了很多事情,所以除非有人请求,否则我不会发布它。
谢谢,
本
I've built an ASP User Control that implements the AJAX Control Toolkit PopupControlExtender.
It pops up a div containing a text box, and an OK/Cancel button. The idea is that the user can click a "rename" icon, which displays the popup with a message saying "Please enter the new name" and a text box with the old name already populated and highlighted, so that when the user starts to type, it immediately overwrites the old name, or the user can simply edit the existing name.
I can work out some simple Javascript to set the focus and select the text, but how do I get it to execute just as the popup is displayed? The text box is populated during an AJAX call back.
The code for my user control is quite large because it's doing a lot of stuff, so I won't post it unless anyone requests it.
Thanks,
Ben
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论