asp.net dropdownlist控制textbox的值 我想让dropdownlist控制textbox的值:当dropdownlist的只改变时,texbox显示dropdownlist的选中值。不需要提交的那种!局部刷新实现的! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 updatepanel <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <div> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:DropDownList ID="ddlLB" runat="server" Width="15%" AutoPostBack="True" OnSelectedIndexChanged="ddlLB_SelectedIndexChanged"> </asp:DropDownList> </ContentTemplate> </asp:UpdatePanel> </div> protected void ddlLB_SelectedIndexChanged(object sender, EventArgs e) { if(this.ddlLB.SelectedValue!=null) { string s=this.ddlLB.SelectedValue; } } <asp:DropDownList ID="DropDownList1" runat="server" onclick="document.getElementById('TextBox1').value = document.getElementById('DropDownList1').value;">.........................</asp:DropDownList> 如何使用Cookies? 关于locator.ConnectServer问题 高手请进 关闭子窗口传值问题 一个关于GridView中RowUpDating的小问题 用WebRequest获取当前页的html源码生成静态页面的问题? 我想用Javascript实现点击选择的效果,如何实现? 在ListBox中如何才能创建多列啊? Windows server2008R2下IE10的问题 发个帖子散散分 大型网站导航和页脚怎么处理 嵌套iframe跳动问题 System.ArgumentNullException: 值不能为空。。。。类型初始值设定项引发异常
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlLB" runat="server" Width="15%" AutoPostBack="True" OnSelectedIndexChanged="ddlLB_SelectedIndexChanged">
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</div>
protected void ddlLB_SelectedIndexChanged(object sender, EventArgs e)
{
if(this.ddlLB.SelectedValue!=null)
{
string s=this.ddlLB.SelectedValue;
}
}
...........
..............
</asp:DropDownList>