问题描述
我在asp.net中有一个疑问,我创建了两个usercontrols.一个包含一个下拉列表,另一个包含标签.每当用户在第一个用户控制中更改该值时,该值就会显示在标签中.每当我更改该值时,页面就会打入服务器并附带结果.
我想每当更改dropdownlist中的值时,都应在标签中显示它.但该页面不会再次打入服务器.可能.如果有可能,请告诉我该怎么做.如果可以的话,请给我提供任何示例代码
问候,
Manikanta.
Hi,
I have a doubt in asp.net, I created two usercontrols. One contains a dropdownlist and another contain label. When ever the value changed in first user control that value displayed in the label. Every time when i changed the value the page hit the server and comes with the result.
I want whenever i change the value in dropdownlist it should be diplayed in the label. but the page dont hit the server again.possible. if it is possible tell me the way how it can be do it. give me any sample code if it is possible
regards,
Manikanta.
推荐答案
function populateLabel()
{
var ddCtrl = document.getElementById("DropDownCotrolClientId");
var ddCtrlVal = e.options[e.selectedIndex].value;
document.getElementById(''LabelCotrolClientId'').Value = ddCtrlVal;
}
这应该和上面一样简单...尝试一下.
This should be as simple as above... try it out..
这篇关于有关用户控制的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!