繁体   English   中英

具有主页的Facebook iframe应用程序不会触发OnSelectedIndexChanged事件

[英]facebook iframe application ,with master page, doesn't firing OnSelectedIndexChanged event

这是我的单选按钮列表:

   <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");
    }

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

您需要在RadioButtonList的定义上添加AutoPostBack =“ true”。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM