Creating User Controls Dynamically - Object Reference Not Set erro

  • Thread starter Andrew Crossley
  • Start date
A

Andrew Crossley

I'm creating some user controls dynamically in my page_load event in asp.net
1.1. The user controls have a few labels on them but when I access the
control using MyUserControl.MyLabel during the page load event I get an
Object Reference not set to an instance of an object error. When I debug the
code I find the labels or text boxes are = Nothing.
I've created the labels by dragging them onto the page. The user control
exists but the labels don't.
Have I missed something obvious?
Thanks
 

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

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top