根据下拉列表中选择的值填充文本框

根据下拉列表中选择的值填充文本框

问题描述:

请提供帮助.

我想根据下拉列表中选择的值来填充文本.
我有一个下拉列表,我现在在其中显示一个主题"字段,我想针对所选下拉列表的正文"字段填充文本框.


please help required.

i want to fill a text based on the value selected in the dropdownlist.
i have a dropdownlist in which i am displaying a field "subject" now i want to fill the textbox by "Body" field against the selected dropdownlist.


please help needed urgent.

好,winforms或webforms,您所需要做的就是在dropdownlist selectionchange事件中编写代码.在这种情况下(当您在下拉列表中选择其他值时会出现此情况),找到所选值并使用它来获取适当的正文,并将其分配给文本框.

试试吧!
Well, winforms or webforms, all you need is to write the code in the dropdownlist selectionchange event. In the event (which would be raised when you select a different value in your dropdowlist), find the selected value and use it to to get the appropriate body text and assign it to the textbox.

Try!