How to check whether UpdatePanel is posting back?

后端 未结 3 890
独厮守ぢ
独厮守ぢ 2021-01-04 18:46

Is there a way to determine if an has performed an Ajax postback similar to how we can use...

if(!Page.IsPostBack) { .         


        
3条回答
  •  有刺的猬
    2021-01-04 19:09

    Try out following:

    var controlName = Page.Request.Params.Get("__EVENTTARGET");
    if (!String.IsNullOrEmpty(controlName))
    {
         // Use FindControl(controlName) to see whether 
         // control is of UpdatePanel type
    }
    

    Helpful links:

    • ASP.NET: Recursive FindControl & Extension Methods

提交回复
热议问题