I have a calendar control assigned to a textbox
I would like to know how to do the on change of the date and check if it matches todays date. if it matches a button would be enabled if it wont match the button would be disabled.
Here is the code of the asp.net page
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
Date
<asp:TextBox ID="txtStartDate" runat="server" Height="22px" Width="234px"></asp:TextBox>
<asp:CalendarExtender ID="CalendarExtender1" TargetControlID="txtStartDate" runat="server">
</asp:CalendarExtender>
this is the code i have come up with so far but dont know where to place it or if it is also correct
string today = DateTime.Now.ToShortDateString();
txtStartDate.Text = CalendarExtender1.SelectedDate.ToString();
if (txtStartDate.Text != today)
{
btn_Search.Enabled = false;
}
else
{
btn_Search.Enabled = true;
}
I am working on an asp.net project page Thanks