httpModule is not hitting for FrondEnd Page

joyanta sen asked on August 8, 2018 22:34

Hi, I have created a custom HttpModule using C# and trying do some task while loading a page. I have noticed that for the admin pages the module is getting hit but while running any front end page the module is not getting hit. Could you please let me know what might be the reason?

Thanks, Joyanta

Recent Answers


joyanta sen answered on August 8, 2018 23:59

Hi, Actually what I am trying to do is, I need to replace a link(ex: www.testing.com) in any page with the link(www.testing.com/userid). UserId I am getting from Session.

So I have created http module, which will look through every link in every page whenever that page will load and and if it found then it will append the user id.

My httpmodule is working fine in localhost but when moving to UAT site, it is not working. The module is getting called only for Adming pages not for non-Admin pages.

Please let me know if there is any setting I am missing or if there is any better solution to implement this.

Thanks Joyanta

0 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on August 9, 2018 00:44 (last edited on August 9, 2018 02:48)

did you set <modules runAllManagedModulesForAllRequests="true" > in your web.config. P.S. why do you need a module? what about global events like OnAfterPageRender?

0 votesVote for this answer Mark as a Correct answer

joyanta sen answered on August 9, 2018 00:45

Yes It is set to true.

Thanks, Joyanta

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.