1. 加入引用
Ajax的简单应用之2
2. web.config 文件的配置

Ajax的简单应用之2<?xml version="1.0"?><configuration>
Ajax的简单应用之2    
<configSections>
Ajax的简单应用之2        
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
Ajax的简单应用之2            
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
Ajax的简单应用之2                
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
Ajax的简单应用之2                
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
Ajax的简单应用之2                    
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
Ajax的简单应用之2                    
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
Ajax的简单应用之2                    
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
Ajax的简单应用之2                
</sectionGroup>
Ajax的简单应用之2            
</sectionGroup>
Ajax的简单应用之2        
</sectionGroup>
Ajax的简单应用之2    
</configSections>
Ajax的简单应用之2    
<system.web>
Ajax的简单应用之2        
<pages>
Ajax的简单应用之2            
<controls>
Ajax的简单应用之2                
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
Ajax的简单应用之2                
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
Ajax的简单应用之2            
</controls>
Ajax的简单应用之2        
</pages>
Ajax的简单应用之2        
<!--
Ajax的简单应用之2          Set compilation debug="true" to insert debugging
Ajax的简单应用之2          symbols into the compiled page. Because this
Ajax的简单应用之2          affects performance, set this value to true only
Ajax的简单应用之2          during development.
Ajax的简单应用之2    
-->
Ajax的简单应用之2        
<compilation debug="true">
Ajax的简单应用之2            
<assemblies>
Ajax的简单应用之2                
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
Ajax的简单应用之2            
Ajax的简单应用之2                
<add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Ajax的简单应用之2                
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
Ajax的简单应用之2                
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies>
Ajax的简单应用之2        
</compilation>
Ajax的简单应用之2        
<httpHandlers>
Ajax的简单应用之2            
<remove verb="*" path="*.asmx"/>
Ajax的简单应用之2            
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
Ajax的简单应用之2            
<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"/>
Ajax的简单应用之2            
<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"/>
Ajax的简单应用之2            
<add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax"/>
Ajax的简单应用之2        
</httpHandlers>
Ajax的简单应用之2        
<httpModules>
Ajax的简单应用之2            
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
Ajax的简单应用之2        
</httpModules>
Ajax的简单应用之2    
</system.web>
Ajax的简单应用之2    
<system.web.extensions>
Ajax的简单应用之2        
<scripting>
Ajax的简单应用之2            
<webServices>
Ajax的简单应用之2                
<!-- Uncomment this line to customize maxJsonLength and add a custom converter -->
Ajax的简单应用之2                
<!--
Ajax的简单应用之2      <jsonSerialization maxJsonLength="500">
Ajax的简单应用之2        <converters>
Ajax的简单应用之2          <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>
Ajax的简单应用之2        </converters>
Ajax的简单应用之2      </jsonSerialization>
Ajax的简单应用之2      
-->
Ajax的简单应用之2                
<!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->
Ajax的简单应用之2                
<!--
Ajax的简单应用之2        <authenticationService enabled="true" requireSSL = "true|false"/>
Ajax的简单应用之2      
-->
Ajax的简单应用之2                
<!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved
Ajax的简单应用之2           and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and
Ajax的简单应用之2           writeAccessProperties attributes. 
-->
Ajax的简单应用之2                
<!--
Ajax的简单应用之2      <profileService enabled="true"
Ajax的简单应用之2                      readAccessProperties="propertyname1,propertyname2"
Ajax的简单应用之2                      writeAccessProperties="propertyname1,propertyname2" />
Ajax的简单应用之2      
-->
Ajax的简单应用之2            
</webServices>
Ajax的简单应用之2            
<!--
Ajax的简单应用之2      <scriptResourceHandler enableCompression="true" enableCaching="true" />
Ajax的简单应用之2      
-->
Ajax的简单应用之2        
</scripting>
Ajax的简单应用之2    
</system.web.extensions>
Ajax的简单应用之2    
<system.webServer>
Ajax的简单应用之2        
<validation validateIntegratedModeConfiguration="false"/>
Ajax的简单应用之2        
<modules>
Ajax的简单应用之2            
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
Ajax的简单应用之2        
</modules>
Ajax的简单应用之2        
<handlers>
Ajax的简单应用之2            
<remove name="WebServiceHandlerFactory-Integrated"/>
Ajax的简单应用之2            
<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"/>
Ajax的简单应用之2            
<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"/>
Ajax的简单应用之2            
<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"/>
Ajax的简单应用之2        
</handlers>
Ajax的简单应用之2    
</system.webServer>
Ajax的简单应用之2
</configuration>
3. web页面文件
4. cs文件
Ajax的简单应用之2using System;
Ajax的简单应用之2
using System.Data;
Ajax的简单应用之2
using System.Configuration;
Ajax的简单应用之2
using System.Collections;
Ajax的简单应用之2
using System.Web;
Ajax的简单应用之2
using System.Web.Security;
Ajax的简单应用之2
using System.Web.UI;
Ajax的简单应用之2
using System.Web.UI.WebControls;
Ajax的简单应用之2
using System.Web.UI.WebControls.WebParts;
Ajax的简单应用之2
using System.Web.UI.HtmlControls;
Ajax的简单应用之2
Ajax的简单应用之2
namespace WebApplication7
5. 运行的结果
Ajax的简单应用之2

相关文章: