• 配置Asp.net Ajax Control Toolkit


    1>安装Ajax ASPAJAXExtSetup.msi (在http://ajax.asp.net/下载)
    2>安装Ajax模板 ASPAJAXSamples.msi
    3>下载 最新版本 ajaxcontroltoolkit
      http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=AtlasControlToolkit
    4>解压到C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\AjaxControlToolkit
    5>打开解决方案\AjaxControlToolkit\AjaxControlToolkit.sln,生成工程TemplateVSI
    6>复制  
         \AjaxControlToolkit\SampleWebSite\Bin\AjaxControlToolkit.dll
         \AjaxControlToolkit\SampleWebSite\Bin\AjaxControlToolkit.dll
    到 \AjaxControlToolkit\Binaries\
    7>运行\AjaxControlToolkit\TemplateVSI\bin\AjaxControlExtender.vsi 安装模板(选择C#),仅Web
    8>工具箱点右键添加选项卡AJAX Toolkit,在AJAX Toolkit选项卡里右键选择项,在弹出的对话窗口里面选择.NET Framework
    点浏览 C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\AjaxControlToolkit\Binaries\AjaxControlToolkit.dll

    配置web.config方件

    Web.config是实际上XML文档,其根元素为<configuration>
    <!--配置asp.net ajax webconfig___1-->
        <!--此节点必须作为<configuration>的第一个节点出现-->
       <configSections>
         <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
           <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
            <!--若希望ASP.NET AJAX应用程序在运行时能够对客户端脚本文件进行压缩或缓存,则应该在
             <sectionGroup name="scripting>中定义一个新的<section>如下所示-->
             <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
             <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
               <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" />
               <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
               <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
             </sectionGroup>
           </sectionGroup>
         </sectionGroup>
       </configSections>
    <!--配置asp.net ajax webconfig___2-->
    <!此节点作为<configuration>的一个子节点出现-->
          <system.web.extensions>
              <scripting>
                   <webServices>
                   </webServices>
                  <!--以下这段声明将在程序运行于Release模式时压缩客户端脚本库的大小。
           如果不是程序中有非常特殊的需要,我们绝对应该添加这个HTTP模块以提高网络传输速度-->
                   <scriptResourceHandler enableCompression="true" enableCaching="true"/>
              </scripting>
          </system.web.extensions>
    <!--配置asp.net ajax webconfig___3-->
    <!--在<configuration>根元素中的<system.web>节中注册ASP.NET AJAX服务器端控件的前缀-->
    <pages>
          <controls>
              <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions,Version=1.0.61025.0,            Culture=neutral,PublicKeyToken=31bf3856ad364e35"/>
              <add tagPrefix="asp" namespace="Microsoft.Web.Preview.UI" assembly="Microsoft.Web.Preview"/>
              <add tagPrefix="asp" namespace="Microsoft.Web.Preview.UI.Controls" assembly="Microsoft.Web.Preview"/>
          </controls>
    </pages>
    <compilation debug="true">
          <assemblies>
              <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
              <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
              <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies>
    <!--配置asp.net ajax webconfig___4-->
             <!--修改<compilation>节,允许调试和添加必要的用于调试的程序集-->
               <!--上面代码中同样包含了<buildProviders>以及其中*.asbx文件的声明。若应用程序不需要服务器端远程Web Service桥,则没有必要添加<buildProviders>中的这部分内容-->
              <!--以下此节为新添加-->
          <buildProviders>
              <add extension="*.asbx" type="Microsoft.Web.Preview.Services.BridgeBuildProvider"/>
          </buildProviders>
    </compilation>
    <!--配置asp.net ajax webconfig___5-->
        在<system.web>节点中添加或者修改<httpHandlers>节点
          <!--在<system.web>元素中,若你的ASP.NET AJAX应用程序中需要在客户端调用服务器端的Web Service,则需要对Web Service应用一些新的HTTP Handler,并为其生成必要的客户端JavaScript代理脚本。找到<system.web>元素中的< httpHandlers>子元素,移除现有的Web Service文件(.asmx)的Handler, 然后添加ASP.NET AJAX引入的新的Handler(*.asbx一项同样可以根据需要有选择地添加)-->
    <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"/>
          <add verb="GET,HEAD,POST" path="*.asbx" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
    </httpHandlers>
    <!--配置asp.net ajax webconfig___6-->
    <!--仍然是在<system.web>元素中添加如下的HTTP模块声明-->
    <httpModules>
          <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>
    <!--配置asp.net ajax webconfig___7-->
    <!--在<configuration>节中添加<system.webServer>小节,为Web服务器进行相应的配置(这些配置是可选的,将只应用于IIS7中)-->
    <system.webServer>
          <validation validateIntegratedModeC/>
          <modules>
              <add name="ScriptModule" preC type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
          </modules>
          <handlers>
              <remove name="WebServiceHandlerFactory-Integrated"/>
              <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preC type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
              <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preC type="System.Web.Script.Services. ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
              <add name="ScriptResource" preC verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
              <add name="ASBXHandler" verb="GET,HEAD,POST" path="*.asbx" preC type="System.Web.Script.Services. ScriptHandlerFactory,System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35"/>
          </handlers>
    </system.webServer>

  • 相关阅读:
    javascript入门经典(第五版)-清华出版社之“经典”错误
    在自学css开始就遇到问题,“链入外部样式表”在多浏览器显示问题
    sublime text3 =个人插件
    不错的文章
    Golang逃逸分析
    sublime常用快捷键
    同步机制之一--Synchronized,以及此机制下的锁的本质和种类
    UVa 10976
    LeetCode:Add Digits
    插入排序
  • 原文地址:https://www.cnblogs.com/gyxdbk/p/1412443.html
Copyright © 2020-2023  润新知