To disable autopostback for Calender Control in ASP.net

后端 未结 4 730
广开言路
广开言路 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:44

    It is possible with MS Calendar. You can customize content of each cell in DayRender event:

    protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
        {
            e.Cell.Text = e.Day.DayNumberText;
        }
    

    You can set e.Cell.Text to be div or span with text and javascript onclick event or link. You can put any HTML there.

提交回复
热议问题