【发布时间】:2016-09-11 16:33:12
【问题描述】:
我在用户控件中有 2 个单选按钮,并且控件已注册到页面。当我单击单选按钮时,事件(CheckChanged)没有触发。
<asp:View ID="viewfirst" runat="server">
<asp:UpdatePanel ID="updatepanel1" runat="server" UpdateMode="Always">
<ContentTemplate>
<asp:RadioButton ID="radio1" Text="Yes" Enabled="true" runat="server" />
<asp:RadioButton ID="radio2" Text="No" Enabled="true" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</asp:View>
Below is code in behind file of the control.
Protected Sub radio1_CheckedChanged(sender As Object, e As EventArgs) Handles radio1.CheckedChanged
//
//
End Sub
看起来一切都很好,但有些地方出了问题。请告诉我。
【问题讨论】:
-
那个事件什么都没有,你怎么知道它是否触发?
-
将
autopostback=true添加到单选按钮
标签: asp.net vb.net checkbox radio-button