簡體   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