Rendering Controls

Discussion in 'ASP .Net Web Controls' started by VR, May 16, 2004.

  1. VR

    VR Guest

    Hi, I'm developing a custom control and as the control is getting it's final
    form (and I was starting to getting crazy with that
    RenderBeginTab/RenderEndTag) I tryed sth a little bit different as the code
    found in MS samples in MSDN, could anyone tell me if is there any problem
    using this approach?

    Protected Overrides Sub Render(ByVal output As
    System.Web.UI.HtmlTextWriter)
    output.Write(MyHTML)
    End Sub

    Private Function MyHTML() As String

    Dim strHTML As String
    strHTML = "<table border='1'>" & _
    "<tr>" & _
    "<td valign='top'>" & _
    "<select id='ValuesList'>" & _
    "<option value='option01'>option01" & _
    "</select>" & _
    "</td>" & _
    "<td rowspan='2'>" & _
    "<select id='ValuesSelected' multiple>" & _
    "<option value='option01'>option01" & _
    "</select>" & _
    "</td>" & _
    "</tr>" & _
    "<tr>" & _
    "<td>" & _
    "<input type=button value='Adiciona'
    id='btnAdiciona'>" & _
    "<br>" & _
    "<input type=button value='Remove'
    id='btnRemove'>" & _
    "</td>" & _
    "</tr>" & _
    "</table>"

    Return strHTML

    End Function


    Thanks a lot,
    Victor
     
    VR, May 16, 2004
    #1
    1. Advertising

  2. VR

    Teemu Keiski Guest

    Hi,

    not using built-in rendering methods means that your control can't adapt to
    the client browser (it sends fixed HTML). Even though using pure rendering
    is the more effective approach but have you considered using composition as
    you use such HTML elements whose functionality is already covered by some
    built-in controls (Buttons,ListBox)?

    About composite server controls:
    http://aspalliance.com/359

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist
    http://blogs.aspadvice.com/joteke




    "VR" <> wrote in message
    news:u$...
    > Hi, I'm developing a custom control and as the control is getting it's

    final
    > form (and I was starting to getting crazy with that
    > RenderBeginTab/RenderEndTag) I tryed sth a little bit different as the

    code
    > found in MS samples in MSDN, could anyone tell me if is there any problem
    > using this approach?
    >
    > Protected Overrides Sub Render(ByVal output As
    > System.Web.UI.HtmlTextWriter)
    > output.Write(MyHTML)
    > End Sub
    >
    > Private Function MyHTML() As String
    >
    > Dim strHTML As String
    > strHTML = "<table border='1'>" & _
    > "<tr>" & _
    > "<td valign='top'>" & _
    > "<select id='ValuesList'>" & _
    > "<option value='option01'>option01" & _
    > "</select>" & _
    > "</td>" & _
    > "<td rowspan='2'>" & _
    > "<select id='ValuesSelected' multiple>" & _
    > "<option value='option01'>option01" & _
    > "</select>" & _
    > "</td>" & _
    > "</tr>" & _
    > "<tr>" & _
    > "<td>" & _
    > "<input type=button value='Adiciona'
    > id='btnAdiciona'>" & _
    > "<br>" & _
    > "<input type=button value='Remove'
    > id='btnRemove'>" & _
    > "</td>" & _
    > "</tr>" & _
    > "</table>"
    >
    > Return strHTML
    >
    > End Function
    >
    >
    > Thanks a lot,
    > Victor
    >
    >
    >
     
    Teemu Keiski, May 19, 2004
    #2
    1. Advertising

  3. VR

    VR Guest

    Ok, thanks, I think I really left the auto browser detection feature away
    and this is really not good,

    regards,
    Victor


    "Teemu Keiski" <> wrote in message
    news:%...
    > Hi,
    >
    > not using built-in rendering methods means that your control can't adapt

    to
    > the client browser (it sends fixed HTML). Even though using pure rendering
    > is the more effective approach but have you considered using composition

    as
    > you use such HTML elements whose functionality is already covered by some
    > built-in controls (Buttons,ListBox)?
    >
    > About composite server controls:
    > http://aspalliance.com/359
    >
    > --
    > Teemu Keiski
    > MCP, Microsoft MVP (ASP.NET), AspInsiders member
    > ASP.NET Forum Moderator, AspAlliance Columnist
    > http://blogs.aspadvice.com/joteke
    >
    >
    >
    >
    > "VR" <> wrote in message
    > news:u$...
    > > Hi, I'm developing a custom control and as the control is getting it's

    > final
    > > form (and I was starting to getting crazy with that
    > > RenderBeginTab/RenderEndTag) I tryed sth a little bit different as the

    > code
    > > found in MS samples in MSDN, could anyone tell me if is there any

    problem
    > > using this approach?
    > >
    > > Protected Overrides Sub Render(ByVal output As
    > > System.Web.UI.HtmlTextWriter)
    > > output.Write(MyHTML)
    > > End Sub
    > >
    > > Private Function MyHTML() As String
    > >
    > > Dim strHTML As String
    > > strHTML = "<table border='1'>" & _
    > > "<tr>" & _
    > > "<td valign='top'>" & _
    > > "<select id='ValuesList'>" & _
    > > "<option value='option01'>option01" & _
    > > "</select>" & _
    > > "</td>" & _
    > > "<td rowspan='2'>" & _
    > > "<select id='ValuesSelected' multiple>" & _
    > > "<option value='option01'>option01" & _
    > > "</select>" & _
    > > "</td>" & _
    > > "</tr>" & _
    > > "<tr>" & _
    > > "<td>" & _
    > > "<input type=button value='Adiciona'
    > > id='btnAdiciona'>" & _
    > > "<br>" & _
    > > "<input type=button value='Remove'
    > > id='btnRemove'>" & _
    > > "</td>" & _
    > > "</tr>" & _
    > > "</table>"
    > >
    > > Return strHTML
    > >
    > > End Function
    > >
    > >
    > > Thanks a lot,
    > > Victor
    > >
    > >
    > >

    >
    >
     
    VR, May 21, 2004
    #3
    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. John
    Replies:
    1
    Views:
    417
    Jurjen de Groot
    Jul 10, 2003
  2. Mike Speak
    Replies:
    2
    Views:
    1,853
    Mike Speak
    Nov 22, 2003
  3. Scott Yenor
    Replies:
    0
    Views:
    403
    Scott Yenor
    Jan 22, 2004
  4. news.microsoft.com
    Replies:
    1
    Views:
    554
    Teemu Keiski
    Apr 9, 2005
  5. Peter Mount
    Replies:
    4
    Views:
    1,000
    Peter Mount
    Jan 31, 2006
Loading...

Share This Page