【发布时间】:2010-02-25 23:13:54
【问题描述】:
我的第一个自定义 HTTP 模块,第 1 步 - 刚刚开始工作。
我没有在 200 响应中得到我的字符串,但它在 304 响应中。谁能告诉我我错过了什么?
我的班级:
namespace WebUI.Models
{
public class SimpleModule: IHttpModule
{
public void Dispose()
{
}
public void Init(HttpApplication context)
{
context.EndRequest += OnEndRequest;
}
void OnEndRequest(object sender, System.EventArgs e)
{
HttpContext.Current.Response.Write("rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr");
}
}
}
这是我收到的对 css 文件的请求,最后是我的“rrrrrr..rrrr”:
HTTP/1.1 304 Not Modified
Content-Type: text/html; charset=utf-8
Last-Modified: Sat, 20 Feb 2010 17:20:59 GMT
Accept-Ranges: bytes
ETag: "b0d1d31151b2ca1:0"
Server: Microsoft-IIS/7.0
X-Powered-By: ASP.NET
Date: Thu, 25 Feb 2010 22:57:31 GMT
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
但是 r 没有显示在我对页面 html 的 200 响应中。
感谢您的帮助, 比尔
【问题讨论】: