这个yslx的选项是通过Javascript 得到,我用了个隐藏域 yslx2, 在DropDownList写个什么事件可以将用户选中的值传给yslx2?
<asp:HiddenField ID="yslx2" runat="server" />
<asp:Label ID="Label8" runat="server" Width="90px" Text="选择:" />
<asp:DropDownList runat="server" ID="yslx">
</asp:DropDownList>
<script type="text/javascript">
...............
switch(d)
{
case 1:
document.all("yslx").add(new Option("1","1"));
break
case 2:
document.all("yslx").add(new Option("2","2"));
break
...........
}
<asp:HiddenField ID="yslx2" runat="server" />
<asp:Label ID="Label8" runat="server" Width="90px" Text="选择:" />
<asp:DropDownList runat="server" ID="yslx">
</asp:DropDownList>
<script type="text/javascript">
...............
switch(d)
{
case 1:
document.all("yslx").add(new Option("1","1"));
break
case 2:
document.all("yslx").add(new Option("2","2"));
break
...........
}
或者你可以在自定义控件中去自定义方法实现 不过依旧是用JS优先!!