compositecontrol: design time error creating control, nullreference exception

B

Boot2TheHead

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
 
B

bruce barker

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

-- bruce (sqlwork.com)
 
B

Boot2TheHead

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.
 

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,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top