使能ASP.NET AJAX v1.0到您现有的ASP.NET 2.0网站或Web应用程序。
少量天前,我分享了关于怎样升级您的ASP.NET 1.1到ASP.NET 2.0,我谈论关于使能ASP.NET AJAX v1.0到您现有的网站或Web应用程序的这次。
1) 您必须downlaod和安装ASP.NET 2.0 AJAX引伸1.0。 这里
2) 您可以下载andÂ萃取物the ASP.NET AJAX控制工具箱。 这里
在以后安装它,您将发现您可以创造AJAX使能Web应用程序,当创造新的项目时(网站或Web应用程序)。 您可以也发现有称“AJAX引伸的”一个新的制表符在工具箱。 如果您提取了ASP.NET AJAX控制工具箱,您可以做以下,
1) 创造称“AJAX控制工具箱的”新的制表符;
2) 用鼠标右键单击在被创造的制表符之下和点击“选择项目…”;
3) 点击“浏览…” 并且浏览对您提取ASP.NET AJAX控制工具箱的文件夹,然后浏览“~ \ SampleWebSite \容器\”并且选择AjaxControlToolokit.dll
4) 现在您将看您是立即可用的很多控制。 您可以浏览和观看 “工具箱活” 有样品和想法在控制。
您现在准备建立您的AJAX网站或Web应用程序。 然而,如果您有任何现有的ASP.NET 2.0 WebÂ站点或Web应用程序,您做正常行动写AJAX,您将发现AJAX在您现有的网站或Web应用程序不工作。 您必须做以下为了让您现有的ASP.NET 2.0网站或Web应用程序是“AJAX使能”,
1) 打开web.config从您现有的网站或Web应用程序
2) 增加以下XML在 <配置之下> 表格。
<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=”写电影脚本的” type=” System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 ″>
         <节名=” scriptResourceHandler” type=” System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 ″ requirePermission=”错误” allowDefinition=” MachineToApplication”/>
       <sectionGroup name=” webServices” type=” System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 ″>
         <节名=” jsonSerialization” type=” System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 ″ requirePermission=”错误” allowDefinition=”到处”/>
         <节名=” profileService” type=” System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 ″ requirePermission=”错误” allowDefinition=” MachineToApplication”/>
         <节名=” authenticationService” type=” System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 ″ requirePermission=”错误” allowDefinition=” MachineToApplication”/>
       </sectionGroup>
     </sectionGroup>
   </sectionGroup>
 </configSections> <system.web>
   <页>
     <控制>
       <增加tagPrefix=” asp” namespace=” System.Web.UI” assembly=” System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 ″/>
     </controls>
   </pages>
   <! -
         设置编辑debug=”真实”插入调试
         标志到编写页里。 由于这
         影响表现,设置这价值只配齐
         在发展期间。
   ->
   <编辑debug=”错误”>
     <汇编>
       <add assembly=”System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
     </assemblies>
   </compilation>   <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>
 </system.web> <system.web.extensions>
   <scripting>
     <webServices>
     <!– Uncomment this line to customize maxJsonLength and add a custom converter –>
     <!–
     <jsonSerialization maxJsonLength=”500″>
       <converters>
         <add name=”ConvertMe” type=”Acme.SubAcme.ConvertMeTypeConverter”/>
       </converters>
     </jsonSerialization>
     –>
     <!– Uncomment this line to enable the authentication service. Include requireSSL=”true” if appropriate. –>
     <!–
       <authenticationService enabled=”true” requireSSL = “true|false”/>
     –>     <!– Uncomment these lines to enable the profile service. To allow profile properties to be retrieved
          and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and
          writeAccessProperties attributes. –>
     <!–
     <profileService enabled=”true”
                     readAccessProperties=”propertyname1,propertyname2″
                     writeAccessProperties=”propertyname1,propertyname2″ />
     –>
     </webServices>
     <!–
     <scriptResourceHandler enableCompression=”true” enableCaching=”true” />
     –>
   </scripting>
 </system.web.extensions> <system.webServer>
   <validation validateIntegratedModeConfiguration=”false”/>
   <modules>
     <add name=”ScriptModule” preCondition=”integratedMode” 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” preCondition=”integratedMode”
          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” preCondition=”integratedMode”
          type=”System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
     <add name=”ScriptResource” preCondition=”integratedMode” verb=”GET,HEAD” path=”ScriptResource.axd” type=”System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ />
   </handlers>
 </system.webServer>
Now you are ready to make your web site or web application to be “AJAX Enabled”.
Popularity: 5%
Written by kenlin@HK [MVP]. Read more great feeds at is source WEBSITE
no comments.
Read more articles on msdn and .NET Framework and Visual Studio.
- [+] Digg: Feature this article
- [+] Del.icio.us: Bookmark this article
- [+] Furl: Bookmark this article














