注册 登录
编程论坛 ASP.NET技术论坛

请教关于RadioButtonList联动问题

猫色色 发布于 2009-09-11 11:27, 1060 次点击
我想实现一个当点击RadioButtonList里的一个数据的时候右边的TextBox1.Text,就自动会赋值!
我的代码是这么写的:
显示页
<asp:TextBox ID="TextBox1" runat="server" Height="22px" Width="621px">
<asp:Panel ID="Panel102" runat="server" ScrollBars="Auto"  Height="655px" Width="196px">
 请选择泵站
   <br />
 <br />
    <asp:RadioButtonList ID="RadioButtonList1" runat="server"
 DataTextField="e_name"
DataValueField="e_name" Width="186px" Height="25px" onselectedindexchanged="RadioButtonList1_SelectedIndexChanged" > //这是那句联动的语句
     </asp:RadioButtonList>
    </asp:Panel>

*.asp.cs页
 protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        TextBox1.Text = "234";   
    }
可是现在当单选完数据的时候,没有任何效果,请问各位老师这是为什么?
1 回复
#2
saitor2009-09-11 21:56
加这句 AutoPostBack="true"
1