On Dec 12, 2:02 pm, "John Timney \(MVP\)"
<xyz_j...@timney.eclipse.co.uk> wrote:
> You can do that by overriding the render event, completly replacing the HTML
> should you choose to do so.....or in an ihttpmodule you can add a
[quoted text clipped - 24 lines]
> > kellygre...@nospam.com
> > replace nospam with yahoo
Thanks for the info. So when you Override the Render method is this
the only place where you can manipulate the Response.OutputStream? or
do you get the existing "Rendered Text" as a String from somewhere
else?
Thanks,
Kelly
John Timney (MVP) - 12 Dec 2007 22:41 GMT
Each control has a render method, as does page. Heres an example you can
add to a page to see the results.
protected override void Render(HtmlTextWriter writer) {
// extract all html and override <h2>News List</h2>
System.IO.StringWriter str = new System.IO.StringWriter();
HtmlTextWriter wrt = new HtmlTextWriter(str);
// render html
base.Render(wrt); //CAPTURE THE CURRENT PAGE HTML SOURCE AS STRING
wrt.Close();
string html = str.ToString();
html = html.Replace("text", "<h2>TEXT</h2>");
// write the new html to the page
writer.Write(html);
}
Regards
John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
> On Dec 12, 2:02 pm, "John Timney \(MVP\)"
> <xyz_j...@timney.eclipse.co.uk> wrote:
[quoted text clipped - 35 lines]
> Thanks,
> Kelly