Error rendering control

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I have created a custom composite control, which is a date picker. It works
fine but in the design view I get am "Error creating control" 'caltext'
could not be set on property 'btnCssClass' (caltext is the string I am
assigning for the cssclass of a button on the control). I don't need it to
display anything in design view, a blank grey box would be fine. It's just
this error sometimes stop the whole page from rendering in design view.

What I am doing wrong. I didn't want to put the whole code up as it is long
winded. Regards, Chris.



Public Property btnCssClass() As String

Get

EnsureChildControls()

Return btnDate.CssClass

End Get

Set(ByVal value As String)

EnsureChildControls()

btnDate.CssClass = value

End Set

End Property
 
Chris,

Try to put call to EnsureChildControls conditionally:

If Not Me..DesignMode Then EnsureChildControls()
 
That did the trick. Thanks.

Sergey Poberezovskiy said:
Chris,

Try to put call to EnsureChildControls conditionally:

If Not Me..DesignMode Then EnsureChildControls()
 
Back
Top