ASP.NET中的Dropdwn列表 [英] Dropdwn list in ASP.NET
本文介绍了ASP.NET中的Dropdwn列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在文本框中显示文本消息,该文本消息应与从下拉列表中选择的值相关联.
我该如何实现呢??
i need to display text message in a textbox which should be associated with a value selected from dropdown list.
how can I achieve this???
推荐答案
你好ayush,
仅适用于下拉列表的选定索引更改事件.
hello ayush,
just work on selected index change event of dropdown list.
protected void ddl1_SelectedIndexChanged(object sender, EventArgs e)
{
textbox1.Text=ddl1.SelectedItem.ToString(); // show text of dropdownlist
textbox1.Text=ddl1.SelectedValue.ToString(); // show value of dropdownlist
}
您可以轻松找到这种类型的答案,因此在发布问题之前,应先进行搜索.
希望对您有帮助.
并且,如果有帮助,别忘了将其标记为答案. :)
this type of answer you can find easily so before posting a question you should go for search.
Hope this will help you.
And don''t forget to mark as answer if it helps. :)
使用,
Use,
Textbox1.Text=dropdownlist1.SelectedItem.Text;
这篇关于ASP.NET中的Dropdwn列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文