Hi Telerik,
I'm using ASP.NET AJAX RadControls Q3 2009 and I got problem with RadDatePicker.
Here is the code
I have two RadDatePicker. The only event is changing the RequestedEndDate on RequestedStartDate_Selected.
If I change the RequestedEndDate first, then change the RequestedStartDate; it will throw an error "Object required" (I use the IE Developer tool to debug the error on IE browser). The Javascript line which makes error seems to be "rdpRequestedEndDate.set_minDate(startDate); ".
Please help me to solve this issue.
Thanks a lot.
I'm using ASP.NET AJAX RadControls Q3 2009 and I got problem with RadDatePicker.
Here is the code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> |
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<html xmlns="http://www.w3.org/1999/xhtml" > |
<head runat="server"> |
<title>Test Page</title> |
</head> |
<body> |
<form id="form1" runat="server"> |
<telerik:RadScriptBlock ID="RadCodeBlock" runat="server"> |
<script type="text/javascript"> |
function OnDateSelected(sender, e) |
{ |
if(!sender.isEmpty()) |
{ |
var startDate = sender.get_selectedDate(); |
var rdpRequestedEndDate = $find("<%= rdpRequestedEndDate.ClientID %>"); |
rdpRequestedEndDate.set_selectedDate(startDate); |
rdpRequestedEndDate.set_minDate(startDate); |
} |
} |
</script> |
</telerik:RadScriptBlock> |
<telerik:RadScriptManager ID="ScriptManager" runat="server" /> |
<table> |
<tr> |
<td class="tdLabel" style="text-align: right;"> |
<asp:Label ID="lblRequestedStartDateLabel" Text="Requested Start Date:" runat="server" |
meta:resourcekey="lblRequestedStartDate"></asp:Label> |
</td> |
<td style="text-align: left; "> |
<telerik:RadDatePicker ID="rdpRequestedStartDate" |
DateInput-DisplayDateFormat="dd-MMM-yyyy" runat="server" MinDate="<%#DateTime.Now %>"> |
<Calendar ID="Calendar1" runat="server"> |
</Calendar> |
<ClientEvents OnDateSelected="OnDateSelected" /> |
</telerik:RadDatePicker> |
</td> |
</tr> |
<tr> |
<td class="tdLabel" style="text-align: right; "> |
<asp:Label ID="lblRequestedEndDateLabel" Text="Requested End Date:" runat="server" |
meta:resourcekey="lblRequestedEndDateLabel"></asp:Label> |
</td> |
<td style="text-align: left; "> |
<telerik:RadDatePicker ID="rdpRequestedEndDate" runat="server" MinDate="<%#DateTime.Now %>" |
DateInput-DisplayDateFormat="dd-MMM-yyyy"> |
<Calendar ID="Calendar2" runat="server" Skin="WebBlue"> |
</Calendar> |
</telerik:RadDatePicker> |
</td> |
</tr> |
</table> |
</form> |
</body> |
</html> |
I have two RadDatePicker. The only event is changing the RequestedEndDate on RequestedStartDate_Selected.
If I change the RequestedEndDate first, then change the RequestedStartDate; it will throw an error "Object required" (I use the IE Developer tool to debug the error on IE browser). The Javascript line which makes error seems to be "rdpRequestedEndDate.set_minDate(startDate); ".
Please help me to solve this issue.
Thanks a lot.