Question about the need for and performance of HtmlTextWriter/ HtmlTextWriterTag

  • Thread starter Rukmal Fernando
  • Start date
R

Rukmal Fernando

Hi,

I had a lot of work to do in rendering a custom web control by coding it
using calls like

protected override void Render(HtmlTextWriter output)
{
output.Write(HtmlTextWriterTag.<tag>);
myControl.Render(output);
...
}

Afterwards, I wrote a helper method so that I could build an HTML string
with placeholders for each of the controls and then tokenizing the HTML
string to write the HTML as a string and then calling the control's render
method.

This seemed to work ok, but now I'm wondering why the HtmlTextWriterTag enum
exists and whether my rendering html content as strings is sub-optmal.

If anyone knows how these two techniques execute, I'd be really grateful to
hear from you.

Thanks!

Rukmal.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top