HtmlTextWriter: why do we need it and how is its performance?

Discussion in 'ASP .Net' started by Rukmal Fernando, Oct 3, 2003.

  1. Just rephrasing the subject...

    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>);
    myControl1.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.

    eg: string HTMLString = "<TABLE>...{0}...{1}"
    and pass it in like WriteHTML(HTMLString, myControl1, myControl2...);

    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.
    Rukmal Fernando, Oct 3, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,804
    Smokey Grindel
    Dec 2, 2006
  2. Rukmal Fernando
    Replies:
    0
    Views:
    106
    Rukmal Fernando
    Oct 2, 2003
  3. Rukmal Fernando

    HtmlTextWriter: why do we need it and how is its performance?

    Rukmal Fernando, Oct 3, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    258
    Rukmal Fernando
    Oct 3, 2003
  4. thunk
    Replies:
    1
    Views:
    303
    thunk
    Mar 30, 2010
  5. thunk
    Replies:
    0
    Views:
    469
    thunk
    Apr 1, 2010
Loading...

Share This Page