R
redcrystal
I've created quite a few WebControls with pretty good success. I've
made designers, data-bound controls, and so on. (Thank you to Nikhil
Kothari and Vandana Datye for "Developing Microsoft ASP.NET Server
Controls and Components".) I'm pretty comfortable with them now.
However, occasionally, some of the simple composite controls do not get
rendered at design time. All that shows up is the litte green boxed
triangle placeholder icon that the VS.NET designer puts in the top left
corner of all server controls. The control still shows up in the
property browser, and there are no errors displayed. The control always
renders property at run time. What's more, if I have several controls
on a designer, some will render, and some won't.
My GetDesignTimeHtml method usually looks something like this:
Public Overrides Function GetDesignTimeHtml() As String
Dim field As BaseField = CType(Component, BaseField)
Dim controls As ControlCollection = field.Controls
Dim html As String
Dim wasBlank As Boolean = field.Text.Length = 0
Try
If field.ReadOnly And wasBlank Then
field.Text = "[Value]"
End If
html = MyBase.GetDesignTimeHtml
Catch ex As Exception
html = MyBase.GetErrorDesignTimeHtml(ex)
Finally
If wasBlank Then
field.Text = String.Empty
End If
End Try
Return html
End Function
Has anyone else seen this happen and knows what causes it?
Thanks,
->Alan
made designers, data-bound controls, and so on. (Thank you to Nikhil
Kothari and Vandana Datye for "Developing Microsoft ASP.NET Server
Controls and Components".) I'm pretty comfortable with them now.
However, occasionally, some of the simple composite controls do not get
rendered at design time. All that shows up is the litte green boxed
triangle placeholder icon that the VS.NET designer puts in the top left
corner of all server controls. The control still shows up in the
property browser, and there are no errors displayed. The control always
renders property at run time. What's more, if I have several controls
on a designer, some will render, and some won't.
My GetDesignTimeHtml method usually looks something like this:
Public Overrides Function GetDesignTimeHtml() As String
Dim field As BaseField = CType(Component, BaseField)
Dim controls As ControlCollection = field.Controls
Dim html As String
Dim wasBlank As Boolean = field.Text.Length = 0
Try
If field.ReadOnly And wasBlank Then
field.Text = "[Value]"
End If
html = MyBase.GetDesignTimeHtml
Catch ex As Exception
html = MyBase.GetErrorDesignTimeHtml(ex)
Finally
If wasBlank Then
field.Text = String.Empty
End If
End Try
Return html
End Function
Has anyone else seen this happen and knows what causes it?
Thanks,
->Alan