c# - What event should I use in the IHttpModule to disable website? -


i want disable website programatically licensing reasons, , want in httpmodule.

ive tried redirect context :

public void init(httpapplication context) {     context.response.redirect("http://vls.pete.videolibraryserver.com"); } 

but error:

response not available in context. 

anybody know how can disable website , preferably send them custom page.

you can use beginrequest event redirection, following:

public void init(httpapplication context) {     context.beginrequest += new eventhandler(context_beginrequest); }  void context_beginrequest(object sender, eventargs e) {     httpapplication application = (httpapplication)sender;     application.context.response.redirect("http://vls.pete.videolibraryserver.com"); } 

Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -