compositecontrol: design time error creating control, nullreference exception

Discussion in 'ASP .Net' started by Boot2TheHead, Sep 6, 2007.

  1. Boot2TheHead

    Boot2TheHead Guest

    I've created a composite control that uses 6 textboxes and 2 buttons.
    The control works fine, but the design time is frequently goofed up.
    I've never gotten the thing to render in design time but it has always
    rendered it's properties and events to the properties window. Now I'm
    not even getting that. I opened it up this morning and added 3
    properties and made a small change to the html render method. This
    stuff is frustrating because there is no way that I know of to debug
    the darn thing. I'm getting a null reference but I have no idea where
    or if it's even in my code.

    I went through and checked all of my fields and they all have default
    values set. All of the child controls are initialized too.

    This has very little impact on my use of the control, but I'd like to
    release it to the rest of the group and I don't want it to be sloppy.
    And I'd like it to be easy to use
     
    Boot2TheHead, Sep 6, 2007
    #1
    1. Advertisements

  2. Boot2TheHead

    bruce barker Guest

    Re: compositecontrol: design time error creating control, nullreferenceexception

    Page.Request is null at design time, so be sure it not referenced at
    design time.

    -- bruce (sqlwork.com)

    Boot2TheHead wrote:
    > I've created a composite control that uses 6 textboxes and 2 buttons.
    > The control works fine, but the design time is frequently goofed up.
    > I've never gotten the thing to render in design time but it has always
    > rendered it's properties and events to the properties window. Now I'm
    > not even getting that. I opened it up this morning and added 3
    > properties and made a small change to the html render method. This
    > stuff is frustrating because there is no way that I know of to debug
    > the darn thing. I'm getting a null reference but I have no idea where
    > or if it's even in my code.
    >
    > I went through and checked all of my fields and they all have default
    > values set. All of the child controls are initialized too.
    >
    > This has very little impact on my use of the control, but I'd like to
    > release it to the rest of the group and I don't want it to be sloppy.
    > And I'd like it to be easy to use
    >
     
    bruce barker, Sep 6, 2007
    #2
    1. Advertisements

  3. Boot2TheHead

    Boot2TheHead Guest

    My only call to the Page object is in OnPreRender. So no worries
    there. But it was a good thing to check. I added a null check in front
    of the call to the Page object just to be safe.

    On Sep 6, 1:09 pm, bruce barker <> wrote:
    > Page.Request is null at design time, so be sure it not referenced at
    > design time.
    >
    > -- bruce (sqlwork.com)
     
    Boot2TheHead, Sep 6, 2007
    #3
    1. Advertisements

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. Ravi Ambros Wallau
    Replies:
    0
    Views:
    4,187
    Ravi Ambros Wallau
    Jun 1, 2005
  2. Replies:
    0
    Views:
    602
  3. Matt Winward
    Replies:
    0
    Views:
    682
    Matt Winward
    Mar 20, 2008
  4. DispEventAdvise fails with 0x80040202

    NullReference Exception with HttpModule

    DispEventAdvise fails with 0x80040202, Mar 24, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    392
    DispEventAdvise fails with 0x80040202
    Mar 24, 2008
  5. Replies:
    5
    Views:
    550
    Raymond Roelands
    Jul 6, 2006
Loading...

Share This Page