Help! I am working on a control that will search for tooltips (In the title attribute) in the post-rendered output stream for a common phrase (such as Tip: 203) and replace that with information from a database. Once the page is sent, javascript will then take
over and produce help popup boxes on my forms. My problem is tapping into the output stream after the page has been rendered. From there it should do it's replaces, and then feed to modified stream back to the client. Any help or suggestions are greatly appreciated.
-Derek
Derek- I believe you'll need to do this in the global.asax file. The PreSendRequestContent event is the right stage fo ryou to read the Response.Outputstream property and modify it as applicable. Does this help?
Thanks for the suggestion Brian. There is one more piece of functionality that i would like to have which that method did not allow, which is selective replacements based on the page. Some of the pages on the site should not have the enhanced tooltips. I initially
started out by building a server control, but i could only access the render block of itself, and not the page outputstream. I found an article on how to capture the output via the Render block of the page itself, but that would be a hassle to add this code
to all pages, and newly created ones. My idea then is to create a inherited web.ui.page class with a "RenderToolTips" property, and build the code right into the Render event. I have not done any work on modifying the page class, do you think think is a fesiable
idea? http://west-wind.com/weblog/posts/481.aspx
Better override Tooltip property of the control itself to read it from the database. If you are localizing the Tooltip, as an alternative to Database, you can also use "Resource" files which will be faster than retrieving it from the database.
None
0 Points
6 Posts
Post-render parsing
Jul 12, 2004 01:53 PM|h0ckey09|LINK
Member
70 Points
921 Posts
MVP
Re: Post-render parsing
Jul 12, 2004 09:47 PM|bdesmond|LINK
Windows Server MVP - Directory Services
http://www.briandesmond.com
None
0 Points
6 Posts
Re: Post-render parsing
Jul 13, 2004 11:00 AM|h0ckey09|LINK
Member
70 Points
921 Posts
MVP
Re: Post-render parsing
Jul 13, 2004 01:54 PM|bdesmond|LINK
Windows Server MVP - Directory Services
http://www.briandesmond.com
None
0 Points
272 Posts
Re: Post-render parsing
Jul 24, 2004 11:09 PM|MHP|LINK