zoukankan      html  css  js  c++  java
  • UpdateProgress的AssociatedUpdatePanelID属性增加后依然不显示的问题解决(转载)

    UpdateProgress的显示有几种注意情况:

    1、 如果UpdateProgress UpdatePanel<ContentTemplate> 中,则会显示UpdateProgress中的提示信息。

    2、 如果UpdateProgress UpdatePanel<ContentTemplate> 外,则需要指定AssociatedUpdatePanelID属性,但还有一个前提就是触发事件的Button控件必须在UpdatePanel<ContentTemplate> 中,否则就得用第三步骤解决。

    3、 如果触发事件的Button控件和UpdateProgress都在UpdatePanel<ContentTemplate> 外的话,除了要指定AssociatedUpdatePanelID属性的UpdatePanelID外还要将如下代码加入页面中,例如:

     

    View Code
    <Triggers>
        
    <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Event"/>
    </Triggers>


    <script language="JavaScript" type="text/javascript">
    var prm = Sys.WebForms.PageRequestManager.getInstance(); 
    prm.add_initializeRequest(InitializeRequest);
    prm.add_endRequest(EndRequest);
    var postBackElement;
    function InitializeRequest(sender, args)

      
    if (prm.get_isInAsyncPostBack())
      args.set_cancel(
    true);
      postBackElement 
    = args.get_postBackElement(); 

      
    if (postBackElement.id == 'Button1')
      $get(
    'UpdateProgress1').style.display = 'block';
    }
    function EndRequest(sender, args)

      
    if (postBackElement.id == 'Button1')
      $get(
    'UpdateProgress1').style.display = 'none'
    }


    </script>

     

    整理转载自:http://www.cnblogs.com/wangduck/archive/2008/11/17/associatedupdatepanelid.html

  • 相关阅读:
    P3350 [ZJOI2016]旅行者
    P4178 Tree
    P2375 [NOI2014]动物园
    P2827 蚯蚓
    1002: [FJOI2007]轮状病毒
    1070: [SCOI2007]修车
    AtCoder Grand Contest 021完整题解
    Running to the End(Codeforces & AtCoder 百套计划)
    SDWC2017游记
    非传统题初探——AtCoder Practice Contest #B
  • 原文地址:https://www.cnblogs.com/hanguoji/p/2082485.html
Copyright © 2011-2022 走看看