Scenario of Page1
--one checkbox
--fromdate and todate [Both are calendar control]
-->both fromdate and todate are coming from calendar control
-->task is : both fromdate and todate should be in disabled mode in start. Once i check the checkbox both fromdate and todate should be enabled
-------------------page1.aspx--------------------
<tr>
<td align="left" class="style2" colspan="4">
<asp:CheckBox ID="chkroleid" runat="server" Text="Assign Role For Particular Duration"
OnCheckedChanged="chkroleid_CheckedChanged" />
</td>
</tr>
<tr id="FirstRow" runat="server">
<td class="lavel">
<asp:Label ID="ll_Appointment_Date" runat="server" Text="From Date"></asp:Label>
</td>
<td width="25%">
<uc3:CalendarControl ID="txt_Appointment_From_Date" runat="server" ShowTime="true"
SetEnabled="false" />
</td>
<td class="label" width="10%">
<asp:Label ID="Label2" runat="server" Text="To Date"></asp:Label>
</td>
<td width="25%">
<uc3:CalendarControl ID="txt_Appointment_To_Date" runat="server" ShowTime="true"
SetEnabled="false" />
</td>
</tr>
-------------------------------------------------------------------------------------
SetEnabled="false"
now this function is declared in calendar user control as below
----------------------------------------------------------------------
public bool SetEnabled
{
get
{
return this.txtCalendarValue.Enabled;
}
set
{
this.txtCalendarValue.Enabled = value;
this.hlnkCalLink.Enabled = value;
}
}
-----------------------------------------------------------------------
if i run the code.
both fromdate and todate are disabled
----------------------------------checkbox part------------------------------
now in page1.cs
public void chkroleid_CheckedChanged(object sender, EventArgs e)
{
if (chkroleid.Checked)
{
txt_Appointment_From_Date.SetEnabled = true;
txt_Appointment_To_Date.SetEnabled = true;
}
else
{
txt_Appointment_From_Date.SetEnabled = false;
txt_Appointment_To_Date.SetEnabled = false;
}
}
--now if i run the program.. i find that evenif i check or uncheck ...both fromdate and todate are disabled....and if i put breakpoint in chkroleid_CheckedChanged...the debugger is not going to that checkbox event...
--where i am doing wrong ? Kindly help me resolve this.