A
Antonio Maciel
Hi.
I am trying to add a label in my custom control based on a condition but
could not find how to do it. I have the following code at my Render event:
Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter)
'Get the values to display from a datareader
If drOptions.HasRows Then
Do While drOptions.Read
Dim lblTitle As New Label
If drOptions.GetInt32(1) = 0 Then
lblTitle.Text = drOptions.GetString(2)
Me.Controls.Add(lblTitle)
Else
output.WriteLine("<input type=radio name='rbItems'>"
& drOptions.GetString(2) & "<br>")
End If
Loop
End If
End Sub
That code does not work. How should I add the label before the options as I
need?
Thanks,
Antonio Maciel
I am trying to add a label in my custom control based on a condition but
could not find how to do it. I have the following code at my Render event:
Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter)
'Get the values to display from a datareader
If drOptions.HasRows Then
Do While drOptions.Read
Dim lblTitle As New Label
If drOptions.GetInt32(1) = 0 Then
lblTitle.Text = drOptions.GetString(2)
Me.Controls.Add(lblTitle)
Else
output.WriteLine("<input type=radio name='rbItems'>"
& drOptions.GetString(2) & "<br>")
End If
Loop
End If
End Sub
That code does not work. How should I add the label before the options as I
need?
Thanks,
Antonio Maciel