Last post Sep 30, 2008 07:39 AM by normannescio
Sep 29, 2008 11:54 AM|normannescio|LINK
In my application I am trying to implement a substitution control. It works well unless the render method is overriden to change the HTML-output.
Does anybody know why this happens, and how to get around this?
Sep 29, 2008 12:09 PM|JohnAClee|LINK
can you post the code you are overiding the render method with?
Sep 30, 2008 04:12 AM|normannescio|LINK
Here's the code
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter) Dim stringWriter As StringWriter = New StringWriter() Dim htmlWriter As HtmlTextWriter = New HtmlTextWriter(stringWriter) MyBase.Render(htmlWriter) htmlWriter.Close() Dim html As
String = stringWriter.ToString() 'here the html output is modified html = DissolvingRAID(html) writer.Write(html) End Sub
The problem seems to be to get the HTML by calling Mybase.Render(htmlwriter)
Sep 30, 2008 05:19 AM|JohnAClee|LINK
ther MyBase.Render line needs to be the last line in the function, as you are populating the html after you call this.
Sep 30, 2008 07:39 AM|normannescio|LINK
I need to call MyBase.Render to get the html to be modified later. It writes the string to the variable stringWriter. This code I found in the web and as far as I can see it is the only way to access the HTML-code to be rendered. Or do I have another chance?