Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Error rendering control

Reply
Thread Tools

Error rendering control

 
 
Chris
Guest
Posts: n/a
 
      06-27-2007
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


 
Reply With Quote
 
 
 
 
marss
Guest
Posts: n/a
 
      07-02-2007

Chris wrote:

> Set(ByVal value As String)
>
> EnsureChildControls()
>
> btnDate.CssClass = value
>
> End Set
>
> End Property


Try this, in design-time HttpContext.Current is null.

Set(ByVal value As String)
If (HttpContext.Current <> null) Then
EnsureChildControls()
btnDate.CssClass = value
End
End Set

End Property

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Design Time Error: Error Rendering Control PeterW ASP .Net Web Controls 2 03-30-2006 02:49 AM
IE6 SP1 rendering vs IE6 SP2 rendering Peter Mount HTML 4 01-31-2006 08:01 AM
Why do I get the error "Error Rendering Control" Sanjay Pais ASP .Net Web Controls 1 08-09-2005 09:28 PM
Why do I get the error "Error Rendering Control" Sanjay Pais ASP .Net 0 08-08-2005 05:45 PM
rendering derived control from composite control William French ASP .Net Building Controls 1 12-03-2003 01:20 AM



Advertisments