To disable autopostback for Calender Control in ASP.net

后端 未结 4 770
广开言路
广开言路 2021-01-13 13:00

Iam trying to use System.Web.UI.WebControls.Calender.

But when I select any date , It post backs automatically. Is there any way to avoid this behavior.

(I d

4条回答
  •  臣服心动
    2021-01-13 13:41

    • You cannot disable "Autopostback" of the Standard Calendar control
    • I think you can use CalendarExtender from AjaxToolkit

     
     
     
    

    Remember to add this code at the top of your page:

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc3" %>
    

    Remember, there is a forum about this topic where PLBlum says:

    The Calendar control included with ASP.NET uses postbacks only. If you added Microsoft ASP.NET AJAX to the page and put the calendar into an UpdatePanel, it can reduce the appearance of postbacks by using callbacks. But it still makes a trip to the server for each click on a date or month.

提交回复
热议问题