Month navigation causes postback

4 posts, 1 answers
  1. Phil H.
    Phil H. avatar
    88 posts
    Member since:
    Nov 2008

    Posted 02 Dec 2008 Link to this post

    I am gettting a performance problem with the RADCalendar control.  When one scrolls to a different month a postback occurs.  I need a postback only on selected date changed.
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 03 Dec 2008 Link to this post

    Hi Phil Huhn,

    One suggesction to achieve this functionality is, set the AutoPostBack property to true on client side in "OnDateSelected" eventhandler and then set the "AutoPostBack" to false from the server side in PageLoad event.

    ASPX:
    <telerik:RadCalendar ID="RadCalendar1" Runat="server" AutoPostBack="true">  
        <ClientEvents OnDateSelected="OnDateSelected" /> 
    </telerik:RadCalendar> 

    JavaScript:
    <script type="text/javascript">  
    function OnDateSelected(sender, eventArgs)  
    {  
        sender.set_autoPostBack(true);  
    }  
    </script> 

    C#:
    protected void Page_Load(object sender, EventArgs e)  
    {  
        RadCalendar1.AutoPostBack = false;  


    Thanks,
    Princy.
  3. Phil H.
    Phil H. avatar
    88 posts
    Member since:
    Nov 2008

    Posted 03 Dec 2008 Link to this post

    That is a cool interplay between client and server side!  I have a feeling the above solution is used in many other situations.  So, I renamed the JavaScript function to 'OnChangePostBack' and placed the script in the master-page.
  4. Mattias
    Mattias avatar
    263 posts
    Member since:
    Aug 2012

    Posted 09 Apr 2010 Link to this post

    Hi,
    Just found this thread and I'm using the approach to. Nice!
    But I think it should be integrated into the calendar with a property, like: EnableOnlyClientSideNavigation=true/false

    Regards,
    Mattias
Back to Top