当前位置:编程学习 > C#/ASP.NET >>

asp.net dropdownlist控制textbox的值

我想让dropdownlist控制textbox的值:当dropdownlist的只改变时,texbox显示dropdownlist的选中值。不需要提交的那种!局部刷新实现的!  --------------------编程问答-------------------- 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>
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,