Add Custom Controls Dynamically

R

rwiegel

I want to dynamically add a custom control to a page in ASP.NET. I
have a custom control called BillControl with public properties for
userID, userName, and Amount.

In the Page_Load of the aspx page, I call a method to dynamically
create however many BillControl controls I need and set the
properties.

In the Page_Load of BillControl.ascx, I call a method to set the text
of the labels and text boxes on the BillControl. I get a
NullReferenceException when I try to run. The label and text box
controls are all null, but I don't understand why.

Can anybody hel?

Thanks,

Ryan
 

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,982
Messages
2,570,186
Members
46,739
Latest member
Clint8040

Latest Threads

Top