我不知道这是否会比您的解决方案更好,但是您是否尝试过?
if (scriptManager.GetCurrent(Page).IsInAsyncPostBack){ Control ctrl = GetControlThatCausedPostBack(Page); if (ctrl is UpdatePanel) { //handle updatepanel postback }}private Control GetControlThatCausedPostBack(Page page){ //initialize a control and set it to null Control ctrl = null; //get the event target name and find the control string ctrlName = Page.Request.Params.Get("__EVENTTARGET"); if (!String.IsNullOrEmpty(ctrlName)) ctrl = page.FindControl(ctrlName); //return the control to the calling method return ctrl;}


