.NETGURU
Separating content rendering in BeginRequest/EndRequest
Messages   Related Types
This message was discovered on ASPFriends.com 'aspnghttphandlers' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Dan Green (VIP)
Application_BeginRequest and EndRequest offer an easy way to create
headers and footers across a suite of pages (gotta love the asp.net
runtime).

The issue I have is that the output to be rendered is currently
contained in code, with a bunch of Context.Response.Write methods.

Instead of code, I'd like to have the content to be rendered stored in a
an .aspx-like file.

Is this an easy thing to do? Are there ways of implementing IHttpModule
with a content and code behind file?

I haven't given this a lot of thought, but I thought before I went and
implemented a mechanism that just went and read a text file (acting as
the content file) from the file system I'd ask.

Dan Green
[ http://dotnetdan.com -- putting the dan in .net ]

Reply to this message...
 
    
dave wanta (VIP)
Hi Dan,
Don't know if anyone's replied to this message, but it's also something I'm
very interested in.

The only problem I've had with your scenario, is that ALL pages will have
that same header and footer. This may not be acceptable in some
circumstances. Take for instance News or Tutorial sites. They may have a
print button that allows the user to print the content with no header,
footer, banner ads, etc...

Instead, Jonathan Goodyear wrote an interesting article, that I'm thinking
of implementing (and wish I had on 123aspx.com). He created a new page
object that contains those headers and footers and inherits from that page
object. Let's go one step farther, let's store the header and footer in the
web cache and set the content to expire on the file dependency.

Any thoughts?
Here is the link to JG's article...
http://www.fawcette.com/vsm/2001_12/magazine/columns/aspnet/

Cheers!
dave wanta
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.123aspx.com
The Largest ASP.NET Web Directory!
Find the latest ASP.NET resources --
Subscribe to our newsletter!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: "Dan Green" <Click here to reveal e-mail address>
To: "aspnghttphandlers" <Click here to reveal e-mail address>
Sent: Friday, November 16, 2001 5:42 AM
Subject: [aspnghttphandlers] Separating content rendering in
BeginRequest/EndRequest

[Original message clipped]

Reply to this message...
 
    
Dan Green (VIP)
Hi Dave,

Thanks for the reply. I'm going to take a look at the article.

I really like the web cache idea, btw.

> The only problem I've had with your scenario, is that ALL pages will
have
> that same header and footer.

Does it have to be so? If we were using an HttpModule rather than the
Application_[Begin|End]Request methods, we could at least only enable
the module on certain subdirs (by using the web.config file).

Dan Green
[ http://dotnetdan.com -- putting the dan in .net ]

[Original message clipped]

Reply to this message...
 
 
System.Runtime.Remoting.Contexts.Context
System.Web.IHttpModule




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification