ASP MVC 在 jQuery 添加表行上填充下拉列表
我有一个页面,其中包含几个具有相同内容的下拉列表。该页面一开始只有三个 ddls,但需要根据用户输入添加更多。还有与下拉列表相关的其他信息,这些信息都在表中。因此,当用户单击链接时,我会向表格添加新行文本框和下拉列表。
当我向表中添加一行时,新的下拉列表为空,因为没有与它们关联的视图数据。如何使用 ajax 或 jquery 提取填充新下拉列表所需的视图数据?
I have a page with several drop down lists that all have the same contents. The page starts out with only three ddls, but more need to be added based on user input. There is also other information associated with the drop down lists that is all in a table. So, when the user clicks a link I add a new row of textboxes and drop down lists to a table.
When I add a row to my table, the new drop down lists are empty because there is no view data associated with them. How can I use ajax or jquery to pull the viewdata that I need to populate new drop down lists?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我理解正确的话,您实际上不需要进行 AJAX 调用来获取新 ddls 所需的视图数据。您已经拥有信息,因此只需组织它即可。
If I understand you correctly, you don't really need to make an AJAX call to get at the viewdata needed for the new ddls. You already have the information, so it is just a matter of organizing it.