如何显示与下拉列表中单击的项目相关的数据。 [英] How to display data that is relevant to the item clicked in the dropdown list.
问题描述
我想显示与使用C#在下拉列表中点击的项目相关的数据。例如,我有一个下拉列表项目,如一般评论和评论。页面如下图所示。在下拉列表中选择评论项目时,光标需要指向评论(需要像WORD一样工作。)
一般评论:
不要问我需要写预订申请。准确说明你需要帮助的是什么。
评论:
保持问题尽可能简洁。如果你必须包含代码,请包含最小的代码片段 - 不要转储整个代码库。
Hi,
I would like to display the data that is relevant to the item clicked in the dropdownlist using C#.For Example,I have a dropdownlist items like General comments and Comments.The page looks like as shown below.On selecting the Comments item in the dropdownlist,The cursor need to points the Comments(Need to works like a WORD.)
General comments:
Don''t ask "I need to write a booking application". Specify exactly what it is you need help with.
Comments:
Keep the question as concise as possible. If you have to include code, include the smallest snippet of code you can - do not dump your entire codebase.
推荐答案
它可以使用jquery来完成。
Hi,
it can be accomplished using jquery.
//get all products from DB and save them
ProductList = new ProductsBLL().GetAllProductsList();
this.ddl.DataValueField = "Id";
this.ddl.DataTextField = "ProductName";
this.ddl.DataSource = ProductList;
this.ddl.DataBind();
和jquery
and the jquery
(' #Main_ddl')。change( function (){
alert(
('#Main_ddl').change(function () { alert(
(' #Main_ddl')。val());
});
('#Main_ddl').val()); });
现在,我已经使用了警报,你可以使用ajax调用来使用你的更多代码或者建立逻辑。
谢谢
now, where I have used alert, you can use ajax call to go with your further code or to build a logic.
thanks
这篇关于如何显示与下拉列表中单击的项目相关的数据。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!