1、网站运行原理,浏览器向服务器发出请求→服务器对请求处理返回结果→浏览器再把结果呈现出来。
1)请求(浏览器)→处理(一般处理程序)→响应(web服务器)。
2、两种新建web网站的方法:新建网站、新建项目。
推荐新建→项目→空web应用程序。
3、发现asp其实和jsp有相似之处的。
1)修改默认调试浏览器:新建HTML页→右键浏览方式→选择你想要用的浏览器。
2)默认的一般处理程序代码:Handler1.ashx
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebApplication4
{
/// <summary>
/// Handler1 的摘要说明
/// </summary>
public class Handler1 : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Write("Hello World");
}
public bool IsReusable
{
get
{
return false;
}
}
}
}
4、直接运行会报错
1)