Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 24, 2012 03:00 PM by deepakdelight
Feb 10, 2012 09:43 AM|LINK
I'm using Microsoft Visual Studio and Microsoft SQL Server Management for this.
I implemented a text box with a calendar extender.
What I'm trying to do is to disable the date before TODAY, for example, unclickable.
I found some searches on google. And they are giving me java scripts.
How do I implement this java scripts onto my visual studio ?
Below is the java script:
if (sender._selectedDate < new Date())
alert("You cannot select a day earlier than today!");
sender._selectedDate = new Date();
// set the date back to the current date
Call the code:
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
runat="server" OnClientDateSelectionChanged="checkDate" TargetControlID="TextBox1" />
Please help. Thanks in advance
Feb 10, 2012 09:50 AM|LINK
May be this link will help you.
Feb 10, 2012 09:51 AM|LINK
I can see the code you provided in the below link
It also provides another method using compare validator to your calendar extender.
Why don't you want to use that.
Feb 10, 2012 10:18 AM|LINK
I referred and tried out the validators
However, it returned me with error messages with ANY dates I cicked on.
I used 7 days limit. The picture below will show that it didn't work.
Feb 10, 2012 11:30 AM|LINK
Can you provide the code you placed in your .aspx and also in your page load. so that we can understand exactly what code you have placed and if not me, some one else will be able to assist you with this problem.
Feb 13, 2012 03:02 AM|LINK
You may try StartDate property. So at code behind, Page_Load, try
CalendarExtender1.StartDate = DateTime.Now;
Feb 24, 2012 03:00 PM|LINK
The StartDate property for CalendarExtender is not available with my AJAX Extender .Why?