Contact Sales: +1-888-365-2779
Community & Support
Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Calendar > Autopostback with datepicker

Answered Autopostback with datepicker

Feed from this thread
  • John avatar

    Posted on May 5, 2009 (permalink)

    Hi,
     I have added button to the footer of the datepicker. When i click on it it calls the "onclientclick" event which populate the today date on the dateinput space and close the datepicker. The issue is,after the after the datepicker is closed there is a automatic postback. I tried to do partialpostback with update panel which did not work too.Please let me know how I can solve the issue and not have automatic postback.

    <FooterTemplate>
                                 <asp:ImageButton ID="IBToday" runat="server" OnClientClick="SelectToday()" ImageUrl="~/Skins/Web20/Calendar/MonthYearTodayBtn.gif" />
     </FooterTemplate>

    function SelectToday()
    {
        var currentDate = new Date()
        var picker = $find("<%= datepicker1.ClientID %>");
        picker.set_selectedDate(currentDate);   
        picker.hidePopup();       

    }

    Reply

  • Answer Princy MVP avatar

    Posted on May 6, 2009 (permalink)

    Hi John,

    Add return false; in OnClientClick of ImageButton in order to avoid the postback.

    ASPX:
     
    <telerik:RadDatePicker ID="datepicker1" runat="server">  
        <Calendar runat="server">  
        <FooterTemplate> 
            <asp:ImageButton ID="IBToday" runat="server" OnClientClick="SelectToday(); return false;" ImageUrl="~/Images/Today.gif" /> 
        </FooterTemplate>          
        </Calendar> 
    </telerik:RadDatePicker> 

    Thanks,
    Princy.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Calendar > Autopostback with datepicker
Related resources for "Autopostback with datepicker"

ASP.NET Calendar Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]