c# updatepanel with timer page_load

后端 未结 4 1759
感情败类
感情败类 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:19

    Not sure what what an AJAX.Net post back looks like to, But I usually protect my other controls and content by checking for post back;

    protected void Page_Load(object sender, EventArgs e)
    {
    
         // if its a post back then my controls should already be setup... 
         if (!Page.IsPostBack)
         {
              InitControlData();
         }    
    }
    

    and then it should fall thru to your event handling?

    protected void timer_tick(object sender, EventArgs e)
    {
        // Do my Ajaxy work~
    }
    

提交回复
热议问题