c# updatepanel with timer page_load

后端 未结 4 1727
感情败类
感情败类 2021-01-23 10:02

I\'m experimenting with some AJAX now. I have a custom control which appears on my masterpage in which there is an update panel and a timer. The timer fires and the panel upda

4条回答
  •  终归单人心
    2021-01-23 10:18

    You could take a look at Request["__EVENTTARGET"] in the page load event to see what control caused the postback. If it's the timer control, jump out of the function.

    Assuming your timer is called "refreshtimer":

    protected void Page_Load(object sender, EventArgs e)
    {
       if (Request["__EVENTTARGET"] == "refreshtimer")
       {
           return;
       }
       // etc
    

提交回复
热议问题