I am trying to convert all the classic controls to the new ones and while converting the webdatechooser to webdatepicker, I ran into an issue. I can select the dates in webdatepicker the first time but after that the dropdown does not opne at all. Also I have the webdatepicker inside and asyncrefreshpanel.Please help
<igeditor:WebDatePicker ID="FromDateChooser" BorderWidth="1px" ClientIDMode="Static"
runat="server" NullDateLabel=" " Value="<%#DateTime.Now - TimeSpan.FromDays(365)%>"
DropDownCalendarID="WebMonthCalendar1"
ShowMonthDropDown="False" ShowYearDropDown="False">
<ClientSideEvents ValueChanging="set_str_date" />
</igeditor:WebDatePicker>
<igeditor:WebMonthCalendar ID="WebMonthCalendar1" runat="server" Height="150px" TitleFormat="MonthAndYear"
ShowNextPrevMonth="true" ShowFooter="False" NextPrevFormat="ShortMonth" ShowMonthDropDown="False" ShowYearDropDown="False">
</igeditor:WebMonthCalendar>
<igeditor:WebDatePicker ID="ToDateChooser" BorderWidth="1px" runat="server" NullDateLabel=" " ClientIDMode="Static"
DropDownCalendarID="WebMonthCalendar2"
<%-- <AutoPostBackFlags ValueChanged="On" />--%>
<ClientSideEvents ValueChanging="set_end_date" />
<igeditor:WebMonthCalendar ID="WebMonthCalendar2" runat="server" TitleFormat="MonthAndYear" Height="150px"
<%-- <AutoPostBackFlags SelectionChanged="On" />--%>
<script type="text/javascript">
function set_str_date(sender, args)
{
if ($find("<%= FromDateChooser.ClientID %>").get_value() != "" &&
$find("<%= ToDateChooser.ClientID %>").get_value() < args.get_value())
args.set_cancel(true);
}
function set_end_date(sender, args)
if ($find("<%= ToDateChooser.ClientID %>").get_value() != "" &&
$find("<%= FromDateChooser.ClientID %>").get_value() > args.get_value())
</script>
Please help..whats going wrong?its urgent
Hi,
Thank you for report.
You mentioned that WebDatePicker is located in "asyncrefreshpanel", I assume that is WebAsyncRefreshPanel (WARP). If your application uses autopostback or similar, then that is the reason for misbehavior. The ajax enabled controls such as UpdatePanel, WebTextEditor, WebDataGrid, WebTab, etc. can exist on same page with normal controls such WARP, UltraWebTab, WebDateTimeEdit, etc., but they can not be cross located inside of their async containers.
After any async postback triggered by WARP, any child which implements IScriptControl will be destroyed. For example, WebDateChooser and WebDateTimeEdit can not be located in WARP.After any async postback triggered by UpdatePanel, any child which does not implement IScriptControl will be destroyed. For example, WebDateChooser and WebTextEdit can not be located in UpdatePanel or its wrappers such as ajax enabled tab in WebTab.
It means that if application decided to replace WebDateChooser or WebDateTimeEdit by WebDatePicker or WebDateTimeEditor, then it should ensure that old possible WARP container is replaced by UpdatePanel. If that is not possible, then WARP should be removed and full postback should be used.
I reread previous message and found mistype. Correction:WebDatePicker and WebDateTimeEditor can not be located in WARP.