How to create controls at runtime

M

michele

Hi, i'm trying to create some htmlinputfile controls at runtime in my page,
based on a integer variable (for example 5)
This is simple for the html code, but i don't know how to manage them in the
codebehind file, i've tryed to put them all in an array

protected HtmlInputFile[] filesUp = new HtmlInputFile[total];

but this doesn't work, so i can't get a reference to the controls in the
code...
Please help me
Thanks,
Michele
 
S

Scott M.

Instead of trying to create that control as an array.

Create one at a time inside of a loop that goes [total] times.
You could then place each newly created control in an Array object.
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top