Ajax 工具包 AutoCompleteExtender
我想知道是否有一种方法使用 ajax 工具包 autocompleteextender 来挂钩多个文本框控件。
原因是我们有多个文本框控件,我不喜欢使用 8 个自动完成扩展器来执行相同的操作,因为所有 8 个都需要正确初始化等等,感觉更易于维护。
编辑:
我构建了一个方法来初始化 autocompleteextender 对象并将每个对象传递给该方法,因此我唯一需要为每个对象单独设置的是 ID 和 TargetElementID。至少总比没有好,但我仍然希望有更好的解决方案。
I'm wondering if there is a way using the ajax toolkit autocompleteextender to hook into multiple textbox controls.
The reason is we have multiple textbox controls and I don't fancy using 8 autocompleteextenders to perform the same thing, as all 8 of them would need to be initialized properly and so on, one feels more maintainable.
Edit:
I constructed a method that initializes the autocompleteextender object and pass each object to that method, so the only thing I need to set seperate on each one is the ID and the TargetElementID. At least better than nothing, but I would still appreciate a better solution to this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不是特定于该问题的答案,但我一直使用 Ajax Control 工具包自动完成扩展器,但后来我发现了 Jquery 扩展器,在我看来它要好得多,而且我认为您可以轻松地做您想做的事情,尽管您需要将其分配给 jQuery 中的每个控件,但您只需要 2 个函数,一个用于获取数据,一个用于处理结果。
您执行类似于以下的操作:
您确实必须使用隐藏字段来存储 id,但它可以使用处理程序很好地自动完成。
JQuery 就在这里(我认为)
必须承认我曾经非常信赖该控制工具包,但是引入 Jquery 后,我发现了很多我认为更好的控件!
只是想我会给你一个不同的选择!
Not an answer specific to the question but I had always used the Ajax Control toolkit autocomplete extender but then I discovered the Jquery one, which in my opinion is much better, and I think you could easily do what you want, although you'd need to assign it to each control in jQuery, but you'd only need 2 functions, one to get the data and one to process the results.
You do something similar to follows:
You do have to use hidden fields to store an id, but it autocompletes nicely using a handler.
The JQuery is here (I think)
Must admit I used to swear by that control toolkit, but having been introduced to Jquery I have found loads of controls that I think are much better!
Just thought I'd throw a different option in your direction!