<asp:Table id="Table2" runat="server" CellPadding="1" BorderWidth="1px" Width="240px">
    <asp:TableRow>
       <asp:TableCell>
  <asp:RadioButtonList id="RadioButtonList1" runat="server" AutoPostBack="true">
<asp:ListItem Value="a">a</asp:ListItem>
<asp:ListItem Value="b">b</asp:ListItem>
  </asp:RadioButtonList>
       </asp:TableCell>
    </asp:TableRow>
</asp:Table>
对上面的RadioButtonList1控件加一个SelectedIndexChanged事件?
平台:VS2003
双击是不行的。

解决方案 »

  1.   

    <asp:RadioButtonList ...>是<asp:Table..>的子控件,在设计时期没办法选择到的。可以:1、在HTML,加入OnSelectedIndexChanged
    2、在后置代码定义 protected System.Web.UI.WebControls.RadioButtonList Radiobuttonlist1;
    在InitializeComponent()注册this.Radiobuttonlist1.SelectedIndexChanged += new System.EventHandler(this.Radiobuttonlist1_SelectedIndexChanged);private void Radiobuttonlist1_SelectedIndexChanged(object sender, System.EventArgs e)
    {

    }
      

  2.   

    你先不要把控件放在ASP TABLE中,给RadioButtonList1控件加一个SelectedIndexChanged事件,并写好事件的处理,然后再修改HTML代码,将RadioButtonList1放进asp table