动态创建包含动态数据的下拉列表 [英] Dynamically create a dropdownlist with dynamic data

查看:86
本文介绍了动态创建包含动态数据的下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在运行时创建下拉列表,动态数据下拉计数可能会有所变化取决于表cout



我尝试过:



< asp:dropdonlist id =crunat =server>

i want to create dropdown list in run time with dynamic data dropdown count may be change in depends on the table cout

What I have tried:

<asp:dropdonlist id="c" runat="server">

推荐答案

答案已在评论中多次给出,所以我将参考发布的第一个链接,在C#和VB.Net中使用jQuery AJAX和JSON填充(绑定)ASP.Net DropDownList [ ^ ]。



返回json然后循环并添加选项。实际上很容易。如果你谷歌这样你会看到大量的例子。
The answer has been given several times in comments so I'll refer to the first link posted, Populate (Bind) ASP.Net DropDownList using jQuery AJAX and JSON in C# and VB.Net[^].

Return json and then loop through and add options. Pretty easy actually. If you google for this you'll see tons of examples.


使用插件怎么样? Find here

只需在插件调用之前应用所需的逻辑来绑定数据。如果您使用的是asp.net下拉列表或找到兼容的插件。
what about using a plugin ? Find Here
just apply required logic to bind data before plugin call. If you are using asp.net dropdownlist or find compatible plugin.


这篇关于动态创建包含动态数据的下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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