Page view counter

Post-render parsing

Last post 07-25-2004 12:33 AM by MHP. 4 replies.

Sort Posts:

  • Post-render parsing

    07-12-2004, 1:53 PM
    • Loading...
    • h0ckey09
    • Joined on 07-12-2004, 12:40 PM
    • Dayton, OH
    • Posts 9
    • Points 45
    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
  • Re: Post-render parsing

    07-12-2004, 9:47 PM
    • Loading...
    • bdesmond
    • Joined on 06-15-2002, 6:02 PM
    • Chicago, IL USA
    • Posts 944
    • Points 4,745
    • TrustedFriends-MVPs
    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?
    --Brian Desmond
    Windows Server MVP - Directory Services
    http://www.briandesmond.com
  • Re: Post-render parsing

    07-13-2004, 11:00 AM
    • Loading...
    • h0ckey09
    • Joined on 07-12-2004, 12:40 PM
    • Dayton, OH
    • Posts 9
    • Points 45
    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
  • Re: Post-render parsing

    07-13-2004, 1:54 PM
    • Loading...
    • bdesmond
    • Joined on 06-15-2002, 6:02 PM
    • Chicago, IL USA
    • Posts 944
    • Points 4,745
    • TrustedFriends-MVPs
    This sounds like an excellent plan.
    --Brian Desmond
    Windows Server MVP - Directory Services
    http://www.briandesmond.com
  • Re: Post-render parsing

    07-24-2004, 11:09 PM
    • Loading...
    • MHP
    • Joined on 10-09-2003, 7:51 AM
    • Ottawa, Canada
    • Posts 275
    • Points 1,375
    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.
    -MHP
Page 1 of 1 (5 items)