Hi Cpnet,
As for the problem you mentioned, here is my understanding:
if your custom control is a composite control which use the
"CreateChildControls" to generate the whole controls hierarchy, I think its
ok for use to override the "Render" method and do some modification on the
control's final output. We just need to create HtmlTextWriter through a
StringBuilder and call the
Control's base.Render to get the original Rendered html. Then, we can do
any modification on the stringbuilder as we like. For exmaple:
=====================================
protected override void Render(HtmlTextWriter output)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
HtmlTextWriter writer = new HtmlTextWriter(new System.IO.StringWriter(sb));
base.Render(writer);
//the output has been retrieved in the stringbuilder
//do the modification here
output.Write(sb.ToString());
}
======================================
HOpe helps. Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx