Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Rendering Controls

Reply
Thread Tools

Rendering Controls

 
 
VR
Guest
Posts: n/a
 
      05-16-2004
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



 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      05-19-2004
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
>
>
>



 
Reply With Quote
 
 
 
 
VR
Guest
Posts: n/a
 
      05-21-2004
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
> >
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Controls.Count, Controls.IsSynchronized, and Controls.SyncRoot Nathan Sokalski ASP .Net 4 09-05-2007 03:27 AM
IE6 SP1 rendering vs IE6 SP2 rendering Peter Mount HTML 4 01-31-2006 08:01 AM
Problem rendering child controls when creating a custom control library Scott Yenor ASP .Net 0 01-22-2004 09:16 PM
PLACEHOLDER NOT RENDERING CONTROLS... PLS HELP :-( Mike Speak ASP .Net 2 11-22-2003 12:47 PM
Urgent : Microsoft.Web.UI.Webcontrols not rendering controls to client John ASP .Net 1 07-10-2003 01:53 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57