Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Response.Redirect in HttpModule

Can I do a redirect to a custom page in an HttpModule?

I have an HttpModule A which executes some javascript code when any aspx page is loaded. I would like to have a server side code check to see if the clients browsers supports cookies. Can I place that code in the HttpModule A? If so, in which event? Or do I need to have a new HttpHandler for both purposes?

Also, is it possible to check for cookies in an HttpModule(without a response.redirect)? All solutions I have seen need 2 pages, 1 for setting the cookie and the other for checking if the cookie has actually been created. I am hoping there should be a way to check for cookies at one place.

Thanks in advance

like image 629
AgentHunt Avatar asked May 11 '26 08:05

AgentHunt


1 Answers

Check this out.. http://www.15seconds.com/issue/030522.htm

The key being... Context.RewritePath()

MDSN http://msdn.microsoft.com/en-us/library/system.web.httpcontext.rewritepath.aspx

like image 71
madcolor Avatar answered May 13 '26 20:05

madcolor