2天时间的查资料学习,终于走完了AJAX学习的第一步,第一个例子成功完成……
源代码:
ASPX:
1
CS:
1
using System;
2
using System.Data;
3
using System.Configuration;
4
using System.Web;
5
using System.Web.Security;
6
using System.Web.UI;
7
using System.Web.UI.WebControls;
8
using System.Web.UI.WebControls.WebParts;
9
using System.Web.UI.HtmlControls;
10
using AjaxPro;
11
12
13
[System.Web.Services.WebService]
14
public partial class _Default : System.Web.UI.Page
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Web.Config
1
<?xml version="1.0"?>
2
<!--
3
注意: 除了手动编辑此文件以外,您还可以使用
4
Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的
5
“网站”->“Asp.Net 配置”选项。
6
设置和注释的完整列表在
7
machine.config.comments 中,该文件通常位于
8
\Windows\Microsoft.Net\Framework\v2.x\Config 中
9
-->
10
<configuration>
11
<appSettings/>
12
<connectionStrings/>
13
<system.web>
14
<httpHandlers>
15
<!-- Register the ajax handler 手动添加注册----LiZhi-->
16
<add verb="*" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro"/>
17
</httpHandlers>
18
<!--
19
设置 compilation debug="true" 将调试符号插入
20
已编译的页面中。但由于这会
21
影响性能,因此只在开发过程中将此值
22
设置为 true。
23
-->
24
<compilation debug="false">
25
<assemblies>
26
<add assembly="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
27
<!--
28
通过 <authentication> 节可以配置 ASP.NET 使用的
29
安全身份验证模式,
30
以标识传入的用户。
31
-->
32
<authentication mode="Windows"/>
33
<!--
34
如果在执行请求的过程中出现未处理的错误,
35
则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
36
开发人员通过该节可以配置
37
要显示的 html 错误页
38
以代替错误堆栈跟踪。
39
40
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
41
<error statusCode="403" redirect="NoAccess.htm" />
42
<error statusCode="404" redirect="FileNotFound.htm" />
43
</customErrors>
44
-->
45
</system.web>
46
</configuration>
47
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47