Error rendering control

Discussion in 'ASP .Net Web Controls' started by Chris, Jun 27, 2007.

  1. Chris

    Chris Guest

    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, Jun 27, 2007
    #1
    1. Advertising

  2. Chris

    marss Guest

    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
    marss, Jul 2, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sanjay Pais
    Replies:
    0
    Views:
    2,281
    Sanjay Pais
    Aug 8, 2005
  2. Peter Mount
    Replies:
    4
    Views:
    943
    Peter Mount
    Jan 31, 2006
  3. William French

    rendering derived control from composite control

    William French, Dec 2, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    215
    Wayne
    Dec 3, 2003
  4. Sanjay Pais

    Why do I get the error "Error Rendering Control"

    Sanjay Pais, Aug 8, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    180
    Donald Welker
    Aug 9, 2005
  5. PeterW

    Design Time Error: Error Rendering Control

    PeterW, Mar 29, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    351
    Steven Cheng[MSFT]
    Mar 30, 2006
Loading...

Share This Page