0
客户使用http://aaa.com/uploads/bb/index.html来请求我的ASP.NET MVC网站。我想确保客户有足够的权限访问该网站,所以我需要赶上请求并处理它。我正在使用IHttpModule
来做到这一点。通过asp.net mvc网站的html请求
public class myHttpModule : IHttpModule {
public void Init(HttpApplication context)
{
context.BeginRequest += new EventHandler(context_BeginRequest);
}
void context_BeginRequest(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
Uri url = application.Context.Request.Url;
string path = url.AbsoluteUri;
}
}
的问题是,当第二次使用相同的URL请求的网站,该HttpModule
不能赶上请求。