Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > compositecontrol: design time error creating control, nullreference exception

Reply
Thread Tools

compositecontrol: design time error creating control, nullreference exception

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

 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      09-06-2007
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
>

 
Reply With Quote
 
 
 
 
Boot2TheHead
Guest
Posts: n/a
 
      09-06-2007
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 <(E-Mail Removed)> wrote:
> Page.Request is null at design time, so be sure it not referenced at
> design time.
>
> -- bruce (sqlwork.com)


 
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
NullReference Exception with HttpModule DispEventAdvise fails with 0x80040202 ASP .Net 0 03-24-2008 06:17 PM
DetailsViewUpdateEventArgs and NULLReference Exception studio60podcast@gmail.com ASP .Net 0 10-27-2006 04:29 PM
Nullreference exception in Asynchronous webservice call (.Net 2.0) vecozo@online.nospam ASP .Net Web Services 5 07-06-2006 12:15 PM
NullReference to Web Control in UserControl... please help! =?Utf-8?B?U2FtIE1hcnRpbg==?= ASP .Net 4 03-30-2006 04:34 PM
"Error Creating Control" when creating a custom control (Design Time). Can't see tooltip message. Ravi Ambros Wallau ASP .Net 0 06-01-2005 02:36 PM



Advertisments