Error rendering control

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
 
G

Guest

Chris,

Try to put call to EnsureChildControls conditionally:

If Not Me..DesignMode Then EnsureChildControls()
 
C

Chris

That did the trick. Thanks.

Sergey Poberezovskiy said:
Chris,

Try to put call to EnsureChildControls conditionally:

If Not Me..DesignMode Then EnsureChildControls()
 

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,995
Messages
2,570,228
Members
46,817
Latest member
AdalbertoT

Latest Threads

Top