I am facing an issue where the checked changed event of the first radio button is not firing. I enabled ViewState
but still the issue persists. Please see below code:
<span class="pull-right text-right"> <label class="inline radio"> <asp:RadioButton runat="server" ID="rdoViewAll" CausesValidation="false" GroupName="Filter" Text="View All" AutoPostBack="true" EnableViewState="true" Checked="true" /> </label> <label class="inline radio"> <asp:RadioButton runat="server" ID="rdoViewCurrent" CausesValidation="false" GroupName="Filter" Text="View Current" AutoPostBack="true" /> </label> <label class="inline radio"> <asp:RadioButton runat="server" ID="rdoViewFuture" CausesValidation="false" GroupName="Filter" Text="View Future" AutoPostBack="true" /> </label> </span>
And I am setting the checked changed event on Page_Init
as below:
public void Page_Init(object sender, EventArgs e) { this.rdoViewAll.CheckedChanged += (s, a) => { RebindTerms(); }; this.rdoViewFuture.CheckedChanged += (s, a) => { RebindTerms(); }; this.rdoViewCurrent.CheckedChanged += (s, a) => { RebindTerms(); }; }
One thing I noticed is when I remove the Checked="true"
property on the first radio button the CheckedChanged
event fires successfully. However, I need the first radio button to be checked by default on page load.