1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
public class MonModule : IHttpModule
{
public void Init(System.Web.HttpApplication application)
{
application.BeginRequest += new EventHandler(OnBeginRequest);
application.LogRequest += new EventHandler(OnLogRequest);
}
private void OnBeginRequest(object sender, System.EventArgs e)
{
HttpApplication app = sender as HttpApplication;
string newPath = "http://nouveaupath";
app.Context.RewritePath(newPath)
}
private void OnLogRequest(object sender, System.EventArgs e)
{
//cet événement est lancé avant le "begin request"
}
} |
Partager