Search code examples
c#asp.nethttpmodule

access header of page in httpmodule


Using a httpmodule I want to add a meta tag to all pages in my web application at run time. So I need to access the header section of my page. How can I do this in a httpmodule?


Solution

  • You would be better served by inserting this META tag into the header of your site's Master Page (and creating and using a Master Page if you don't already have one.) That give's you a central location for it, while not having the overhead of a module in the pipeline.

    If you need to use an HttpModule, see this link about installing a response filter.