Write to specific location of page RRS feed

  • Question

  • User1583078828 posted
    Hi, I wrote a HTTPModule to dynamically add a LINK to a stylesheet. Thus the HTTPModule checks the value of a cookie and adds the <link> tag to the present request. I got it working, but I would like the module to add the <link> tag in the <HEAD> section of the page. Right now it either writes it to the beggining of the page, or at the end depending on whether I attach the handler to the .BeginRequest or .EndRequest events. Does anyone have a trick to do this? thanks, sivilian
    Wednesday, March 24, 2004 8:58 AM

All replies

  • User-1645088262 posted
    Have a look at the Response.Filter - you can create a filter stream that can check for the <HEAD> or </HEAD> element as bytes go through and add the bits you want. I have a product in development that does this to add things to both the HEAD and BODY sections of the page and it works very well.
    Wednesday, March 24, 2004 9:27 AM