Here i am using a radio button to calculate the date difference between two textboxes and i am showing it in another textbox.It is working only for the first time when i click the radio button after that it is not working..Here is my code
<asp:RadioButton ID="rdoSpecifiedDates" runat="server" class="bodycontent" GroupName="status"/>
<asp:RadioButton ID="rdoDateRange" runat="server" class="bodycontent"
GroupName="status" oncheckedchanged="rdoDateRange_CheckedChanged" AutoPostBack="true"
/>
<asp:UpdatePanel ID="Update" runat="server">
<ContentTemplate>
<asp:TextBox ID="txtDays" runat="server" CssClass="bodycontent" MaxLength="6" ReadOnly="true"></asp:TextBox>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="rdoDateRange" />
</Triggers>
</asp:UpdatePanel>
and
protected void rdoDateRange_CheckedChanged(object sender, EventArgs e)
{
DateTime startdate=Convert.ToDateTime(txtOStartDate.Text);
DateTime enddate=Convert.ToDateTime(txtOEndDate.Text);
var result = (enddate - startdate).TotalDays;
txtDays.Text =Convert.ToString( result);
}
Any suggestion?