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

Discussion in 'ASP .Net Web Controls' 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. Advertisements

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. Rukmal Fernando
    Replies:
    0
    Views:
    1,076
    Rukmal Fernando
    Oct 3, 2003
  2. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    1,347
    Mark Rae
    Dec 21, 2006
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,799
    Smokey Grindel
    Dec 2, 2006
  4. Rukmal Fernando
    Replies:
    0
    Views:
    166
    Rukmal Fernando
    Oct 2, 2003
  5. thunk
    Replies:
    1
    Views:
    564
    thunk
    Mar 30, 2010
  6. thunk
    Replies:
    0
    Views:
    725
    thunk
    Apr 1, 2010
  7. thunk
    Replies:
    14
    Views:
    885
    thunk
    Apr 3, 2010
  8. Replies:
    0
    Views:
    312
Loading...