facebook iframe应用程序,带有母版页,不会触发SelectedIndexChanged事件

时间:2010-06-30 14:43:45

标签: c# asp.net

这是我的单选按钮列表:

   <asp:RadioButtonList runat="server" ID="rdlTest" OnSelectedIndexChanged="rdlTst_selectedChange">
            <asp:ListItem>1</asp:ListItem>
            <asp:ListItem>2</asp:ListItem>
        </asp:RadioButtonList

这是背后的代码:

protected void rdlTst_selectedChange(object sender, EventArgs e)
    {
        Response.Write("hello");
    }

由于某种原因,它没有触发事件

1 个答案:

答案 0 :(得分:0)

您需要将AutoPostBack =“true”添加到RadioButtonList的定义中。

  <asp:RadioButtonList runat="server" ID="rdlTest" AutoPostBack="true" OnSelectedIndexChanged="rdlTst_selectedChange">
            <asp:ListItem>1</asp:ListItem>
            <asp:ListItem>2</asp:ListItem>
   </asp:RadioButtonList>
相关问题