2016-06-15 3 views
0

ラジオボタンリストとボタンを持つaspxページにアップデートパネルがあります。リストからラジオボタンを選択せず​​にボタンをクリックすると、clickイベントは正常に機能しますが、ラジオボタンの1つをチェックしてそのボタンをクリックすると、ポストバックやボタンのクリックイベントが発生しません。以下は同じのためのスクリーンショットです:アップデートパネル内のラジオボタンを確認した後、ボタンクリックイベントが発生しない

enter image description here

任意の提案や答えが理解されるであろうが!!

+0

私たちに関連するマークアップを表示してください。 – ConnorsFan

答えて

0

下の例を試してみてください:背後

コード:

public partial class AjaxUpdatePanelExample : System.Web.UI.Page 
{ 
    protected void Page_Load(object sender, EventArgs e) 
    { 
     if(!Page.IsPostBack) 
     { 
      RadioButtonList1.DataSource = new List<string> { "option 1", "option 2", "option 3" }; 
      RadioButtonList1.DataBind(); 
     } 
    } 

    protected void btnSubmit_Click(object sender, EventArgs e) 
    { 
     lblSelectedOption.Text = String.Format("Selected option - {0}",RadioButtonList1.SelectedValue); 
    } 
} 

.ASPX:

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
<asp:UpdatePanel ID="UpdatePanel1" runat="server"> 
    <ContentTemplate> 
     <asp:RadioButtonList ID="RadioButtonList1" runat="server"> 
     </asp:RadioButtonList> 
     <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" /> 
     <asp:Label ID="lblSelectedOption" runat="server"></asp:Label> 
    </ContentTemplate> 
</asp:UpdatePanel> 
関連する問題