Rendering Controls

V

VR

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
 
T

Teemu Keiski

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
 
V

VR

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

regards,
Victor
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top