开发者

adding a footer to the page in an HttpModule

开发者 https://www.devze.com 2023-02-02 06:23 出处:网络
I could use late events such as EndRequest开发者_StackOverflow中文版 and put inside Response.Write but this way whatever I\'m adding would come after the/html tag and the HTML won\'t be well formed.Ve

I could use late events such as EndRequest开发者_StackOverflow中文版 and put inside Response.Write but this way whatever I'm adding would come after the /html tag and the HTML won't be well formed.


Very bad practice to use the HttpModule for page footer. This can lead to possible errors with UpdatePanels, and possible with other controls on randomly pages - especial if you try to add controls.

Also its probably delay the load of all pages and eat a lot of memory reading the page and append at the end strings on every single request.

Use a master page !. Its very simple and the correct way.

More to read: Creating a Layout Using Master Pages

0

精彩评论

暂无评论...
验证码 换一张
取 消