如何在asp.net中创建可编辑的DropDownList [英] How to create a editable DropDownList in asp.net

查看:160
本文介绍了如何在asp.net中创建可编辑的DropDownList的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个已经从数据库中获取的数据填充的下拉列表。

现在我想要的是同样的下拉列表是可编辑的,即我可以手动输入一些数据。 br />
我想要这样,如果数据库中没有任何特定数据,可以插入它,如果可用,可以选择它。



因此,下拉列表应该作为下拉列表和文本框。



上述要求是州和城市的页面。因为如果数据库中没有插入任何状态,则应插入城市作为其子项。



是否需要进一步澄清?





****重要****



我想要的是填充ddl从数据库和用户也可以输入一些数据。单击提交按钮时,必须将特定值插入数据库。如果选择了值,则应插入其ID和新项目,而不是新数据。

I want to create a dropdownlist that is already populated by the data fetched from the database.
Now what else I want is that the same dropdownlist is editable i.e. I can manually input some data.
I want to this so that if any particular data is not available in the database it can be inserted & if it is available it can be selected.

Thus the dropdownlist should work as dropdownlist as well as a Textbox.

The above requirement is of a page for state & city. Because if any state is not inserted in the database it should be inserted with city as its child.

Does it need any more clarification?


****IMPORTANT****

What I want is to populate the ddl from database & also an user can input some data. When clicked on submit button that particular value must be inserted into the DB. If value is selected its id & if new item than new data should be inserted.

推荐答案

自定义ASP.NET可编辑DropDownList [ ^ ]


您可以使用ajax弹出控件,如代码项目Search Control





http:// www。 asp.net/AjaxLibrary/AjaxControlToolkitSampleSite/PopupControl/PopupControl.aspx [ ^ ]



http://www.ezzylearning.com/tutorial.aspx?tid=2761931 [ ^ ]
You can use ajax popup control like code project Search Control


http://www.asp.net/AjaxLibrary/AjaxControlToolkitSampleSite/PopupControl/PopupControl.aspx[^]

http://www.ezzylearning.com/tutorial.aspx?tid=2761931[^]

这篇关于如何在asp.net中创建可编辑的DropDownList的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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