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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top