I try to get the selected date from Client-Side but it doesn't work :
var calendar = $find("<%= RadCalendar1.ClientID %>");
var dateselected = calendar.get_selectedDates();
How can I get the first selected date from the list ?
Thanks
5 Answers, 1 is accepted
var dd = new Date(dateselected[0][0], dateselected[0][1]-1, dateselected[0][2]);
But when I specify one client event, there is no more Server-Side event (disabled ?).
I need to use both, is it a bug ?
Thanks
We are unable to reproduce the problematic behavior you are experiencing with the client/server events. Please review the attached application and let us know how it goes.
Kind regards,
Manuel
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
When I set a client and a server event it broked ajax events with Calendar control.
Thanks for your sample.
Unfortunately we can not determine the exact cause for the issue you encountered without a working demo which demonstrates it. Hence I suggest you modify the example my colleague Manuel prepared to replicate the problem or isolate a stripped working version of your project and send it attached to a formal support ticket. We will examine it in detail and will get back to you with our findings.
Best regards,
Stephen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Answer:
Well, cross-page postbacks are implemented using javascript. And when you put return statement like that it ends up into onclick of the rendered button. For example Button like this
<asp:Button ID="Button2" runat="server" Text="Button" PostBackUrl="~/Default4.aspx" OnClientClick="return confirm('Hello');" />
renders
<input type="submit" name="Button2" value="Button" onclick="return confirm('Hello');WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Button2", "", false, "", "Default4.aspx", false, false))" id="Button2" />
As you can see, this effectively prevents rest of the postbacking script from functioning since whatever confirmation box returns, it won't let postback options to be set and therefore prevents cross-page postbacking from working.
Answer is to change confirm check so that it returns only when user click Cancel.
Put the OnClientClick as
OnClientClick ="if(!confirm('OK?'))return false;"
Then the rendered onclick attribute changes
onclick="if(!confirm('OK?'))return false;WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Button2", "", false, "", "Default4.aspx", false, false))"