简体   繁体   English

访问httpmodule页面的页眉

[英]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. 我想使用httpmodule在运行时向Web应用程序中的所有页面添加一个meta标签。 So I need to access the header section of my page. 因此,我需要访问页面的标题部分。 How can I do this in a httpmodule? 如何在httpmodule中做到这一点?

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. 将这个META标记插入网站母版页眉中,可以为您提供更好的服务(如果您还没有母版页,则可以创建并使用母版页。)这为您提供了一个中心位置,同时又没有开销管道中的模块。

If you need to use an HttpModule, see this link about installing a response filter. 如果需要使用HttpModule,请参阅此链接以了解有关安装响应过滤器的信息。

您可能需要HttpApplication及其当前上下文,以便可以修改请求和响应流。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM