zoukankan      html  css  js  c++  java
  • VS2005中配置 ScriptManager,UpdatePanel,UpdateProgress 等AJAX控件 .

    1.  在VS2005的Bin文件中添加对System.Web.Extensions.dll 的引用。

         web.config 中<assemblies></assemblies>之间自动添加对<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>的引用。

        代码如下所示:

    <assemblies>
         <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          ........
    </assemblies>

    2. 在server BIN文件夹下添加文件System.Web.Extensions.dll。


    3. 在<system.web></system.web>之间,在<pages></pages>之后添加以下代码:

    <httpHandlers>
         <remove verb="*" path="*.asmx"/>
         <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
         <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
         <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
    </httpHandlers>
    <httpModules>
         <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>


    4. 在aspx页面添加如下代码片段:

     step1:

    <%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        Namespace="System.Web.UI" TagPrefix="asp" %>

    step2:

    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 

    step3:

    <asp:UpdatePanel ID="UpdatePanel1" runat="server" >
        <ContentTemplate>
          需要刷新的内容
        </ContentTemplate>   
    </asp:UpdatePanel>   

    step4:  

    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" >
        <ProgressTemplate>
             <div class="PleaseWait">
                   Loading......
             </div>
         </ProgressTemplate>
    </asp:UpdateProgress>


    5. 在CSS中添加如下代码片段:

    .PleaseWait{
        height:100px;
        width:400px;
        background-image:url(../images/Green_Big_Rotate.gif);
        padding-left:150px;
        line-height:80px;
        position: fixed;
        _position: absolute;
        top:40%;
        font-size:30px;
    }


    OK, 终于可以实现局部刷新了......

  • 相关阅读:
    hdu acm 2844 Coins 解题报告
    hdu 1963 Investment 解题报告
    codeforces 454B. Little Pony and Sort by Shift 解题报告
    广大暑假训练1 E题 Paid Roads(poj 3411) 解题报告
    hdu acm 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活
    hdu acm 1114 Piggy-Bank 解题报告
    poj 2531 Network Saboteur 解题报告
    数据库范式
    ngnix 配置CI框架 与 CI的简单使用
    Vundle的安装
  • 原文地址:https://www.cnblogs.com/nancyzhang/p/3719356.html
Copyright © 2011-2022 走看看