Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 20, 2012 09:17 AM by nijhawan.saurabh
Member
303 Points
251 Posts
Apr 20, 2012 06:21 AM|LINK
I create a http module to check the page is refreshed or postback
I include this in web config as follows
<add name="Myhandler" type="Myhandler"/>
Now i want that this module work only when request is going for a specific page not for the whole project ,
what can i do for this
All-Star
16400 Points
3173 Posts
Apr 20, 2012 06:30 AM|LINK
One way to do this is to partition your pages into a folder hierarchy and then to add a web.config, with the HttpModule configured, to the subtrees which require that HttpModule.
Or else use HttpHandlers which allow you to specify the path.
Contributor
3712 Points
838 Posts
A Http Module is invoked for every request. Are you sure it's not a Http Handler you are trying to create?
Apr 20, 2012 06:48 AM|LINK
How can i do it by Http Handlers,actually i implement a Ihttpmodile
Apr 20, 2012 06:52 AM|LINK
Implement IHttpHandler instead :)
http://msdn.microsoft.com/en-us/library/system.web.ihttphandler.aspx
Then you add that into the httphandlers section in web.config where you can specify the path
http://msdn.microsoft.com/en-us/library/aa903367(v=vs.71).aspx
Apr 20, 2012 09:17 AM|LINK
I suppose you'd also know the difference between httphandlers and httpmodules before choosing one.
http://www.dotnetjalps.com/2010/12/what-is-difference-between-http-handler.html
vish02chouha...
Member
303 Points
251 Posts
Http Module
Apr 20, 2012 06:21 AM|LINK
I create a http module to check the page is refreshed or postback
I include this in web config as follows
<add name="Myhandler" type="Myhandler"/>
Now i want that this module work only when request is going for a specific page not for the whole project ,
what can i do for this
nijhawan.sau...
All-Star
16400 Points
3173 Posts
Re: Http Module
Apr 20, 2012 06:30 AM|LINK
One way to do this is to partition your pages into a folder hierarchy
and then to add a web.config, with the HttpModule configured, to the
subtrees which require that HttpModule.
Or else use HttpHandlers which allow you to specify the path.
Knecke
Contributor
3712 Points
838 Posts
Re: Http Module
Apr 20, 2012 06:30 AM|LINK
A Http Module is invoked for every request. Are you sure it's not a Http Handler you are trying to create?
.NET Developer (ASP.NET, MVC, WPF) MCTS .NET 4 (Web, WCF)
Blog | Twitter
vish02chouha...
Member
303 Points
251 Posts
Re: Http Module
Apr 20, 2012 06:48 AM|LINK
How can i do it by Http Handlers,actually i implement a Ihttpmodile
Knecke
Contributor
3712 Points
838 Posts
Re: Http Module
Apr 20, 2012 06:52 AM|LINK
Implement IHttpHandler instead :)
http://msdn.microsoft.com/en-us/library/system.web.ihttphandler.aspx
Then you add that into the httphandlers section in web.config where you can specify the path
http://msdn.microsoft.com/en-us/library/aa903367(v=vs.71).aspx
.NET Developer (ASP.NET, MVC, WPF) MCTS .NET 4 (Web, WCF)
Blog | Twitter
nijhawan.sau...
All-Star
16400 Points
3173 Posts
Re: Http Module
Apr 20, 2012 09:17 AM|LINK
I suppose you'd also know the difference between httphandlers and httpmodules before choosing one.
http://www.dotnetjalps.com/2010/12/what-is-difference-between-http-handler.html