Home Search Member List Faq Register Login  
UltimateCalendar
Re: Odd UltimateCalendar behaviour with MS Ajax

Thread Starter: Gaaahhhh   Started: 12-05-2007 5:39 PM   Replies: 2
 Karamasoft Support Forums » General Discussions » UltimateCalendar » Re: Odd UltimateCalendar behaviour with MS Ajax
 Printable Version    « Previous Thread   Next Thread »
  05 Dec 2007, 5:39 PM
Gaaahhhh is not online. Last active: 12/6/2007 9:39:12 PM Gaaahhhh

Top 10 Posts
Joined on 12-03-2007
Posts 14
Odd UltimateCalendar behaviour with MS Ajax
When i put a UltimateCalendar and UltimateDatePicker in a standard MS UpdatePanel ContentTemplate, the calendar popup does not display the correct date the 1st time it is clicked. On subsequent times it works.

Similarly, if i update the UltimateCalendar.SelectedDate and UltimateDatePicker.Selected dates via an Ajax AsyncPostBack, the calendar popup shows the old date until i click it a second time.

My HTML:

..

<form id="form1" runat="server">

<asp:ScriptManager ID="ScriptManager1" runat="server"/>

<asp:UpdatePanel runat="server" id="up">

<ContentTemplate>

<cc1:UltimateDatePicker ID="UltimateDatePicker1" runat="server" UltimateCalendarID="UltimateCalendar1" DateFormat="ddd, dd MMM" ShowCalendarOnTextClick="true" ReadOnly="true"/>

<cc1:UltimateCalendar ID="UltimateCalendar1" runat="server"/></td>

<asp:Button runat="server" ID="butUpdate" Text="Update" OnClick="butUpdate_Click"/>

</ContentTemplate>

<Triggers>

<asp:AsyncPostBackTrigger ControlID="butUpdate" EventName="Click" />

</Triggers>

</asp:UpdatePanel>

</form>
..

My code behind:

protected void Page_Load(object sender, EventArgs e)

{

UltimateCalendar1.SelectedDate = UltimateDatePicker1.SelectedDate = new DateTime(2007, 10, 28);

}

protected void butUpdate_Click(object sender, EventArgs e)

{

UltimateCalendar1.SelectedDate = UltimateDatePicker1.SelectedDate = DateTime.Today;

}

Steps to reproduce:
1) Run project.
2) Click on Calendar Popup - wrong date appears
3) Click on Calendar Popup again - correct date appears
4) Click on Update button - date changes on screen
5) Click on Calendar Popup button - date from step 3 appears
6) Click on Calendar Popup again - correct date appears

Are these components not compatible with MS Ajax? We use this extensively in our site, and cant really change it...


  
  05 Dec 2007, 7:41 PM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: Odd UltimateCalendar behaviour with MS Ajax
If you click on Prev Month button at step 2, you will see that the right date is selected but since you did not specify VisibleDate property, it opens the current month by default. You should set VisibleDate property of your UltimateCalendar control accordingly. We tried the following code and it worked in our tests:

protected void Page_Load(object sender, EventArgs e)
{
   UltimateCalendar1.VisibleDate = UltimateCalendar1.SelectedDate = UltimateDatePicker1.SelectedDate =
new DateTime(2007, 10, 28);
}

protected
void butUpdate_Click(object sender, EventArgs e)
{
   UltimateCalendar1.VisibleDate = UltimateCalendar1.SelectedDate = UltimateDatePicker1.SelectedDate =
DateTime.Today;
}


  
  05 Dec 2007, 8:07 PM
Gaaahhhh is not online. Last active: 12/6/2007 9:39:12 PM Gaaahhhh

Top 10 Posts
Joined on 12-03-2007
Posts 14
Re: Odd UltimateCalendar behaviour with MS Ajax
Yup, that works fine. Thanks for that!
  
 Page 1 of 1 (3 items)
Karamasoft Support Forums » General Discussions » UltimateCalendar » Re: Odd UltimateCalendar behaviour with MS Ajax

You can add attachments
You can post new topics
You can reply to topics
You can delete your posts
You can edit your posts
You can create polls
You can vote in polls
Forum statistics are enabled
Forum is unmoderated

© 2002-2018 Karamasoft LLC. All rights reserved.