asp.net mvc ajax
我正在使用 dropdownlist html 帮助程序,并希望在值更改时对服务器执行 ajax 调用。我已经看到jquery代码dropdownlist.change...
我遇到的问题是我有一系列dropdownlist的名称dropdownlist_1,dropdownlist_2,...
我希望能够为每个dropdownlist指定相同的jquery函数。我无法找到在下拉列表 html 帮助器中指定函数名称的方法。
谢谢, 亨利
I'm using the dropdownlist html helper and would like to perform an ajax call to the server when the value changes. I have seen the jquery code dropdownlist.change...
The problem I have is that I have a series of dropdownlist's name dropdownlist_1, dropdownlist_2, ...
I would like to be able to specify the same jquery function for each of these dropdownlist's. I have not been able to find a way to specify the function name in the dropdownlist html helper.
Thanks,
Henry
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不要尝试在 HtmlHelper 中指定它,而是将类名添加到每个下拉列表中:
或者
然后使用类名通过 jQuery 连接事件:
Instead of attempting to specify it in the HtmlHelper, add a class name to each of your dropdown lists:
or
Then use the classname to hook up the event via jQuery:
试试这个:
你可以调用你想要的函数。
try this:
you can call the function you want.