httpmodules and web or custom controls

F

Felipe Garcia

how to insert a web control or a custom control in the footer of every web
page of a web site ?
i've got only insert simple text, with response.write.

The point is: I have built a feedback control, and i want it to be available
on the footer of every page of my web site.

Thanks.
 
R

Rick Strahl [MVP]

Hi Felipe,

You can do this but you have to manually tell the control to render create
and render itself, because by the time you're out of the Page framework the
rendering is no longer automatic.

If you use PostRequestHandlerExecute() you can instantiate your control and
call its Render method to capture the output, then manipulate the original
text and insert the control. IOW, at that point you need to manipulate the
document text and no longer the Page object.

It's not that difficult to do. I wrote up something similar in my Web Log a
while back here:

http://west-wind.com/weblog/posts/290.aspx

It uses the Page.Render() method of a custom page subclass, but the
concept's essentially the same if you do this in a module. If you really
want to use the control you can possibly try to inject the control into the
page pipeline via one of the other events that fire prior to Render() like
PreRender() or even OnLoad().

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top