How to create controls at runtime

Discussion in 'ASP .Net Web Controls' started by michele, Aug 4, 2004.

  1. michele

    michele Guest

    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
    michele, Aug 4, 2004
    #1
    1. Advertising

  2. michele

    Scott M. Guest

    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.

    "michele" <> wrote in message
    news:cera07$7hv$...
    > 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
    >
    >
    >
    >
    Scott M., Aug 4, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. michele

    How to create controls at runtime

    michele, Aug 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    401
    Scott M.
    Aug 4, 2004
  2. Big Dave

    Create Datagrid Controls as runtime

    Big Dave, Oct 7, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    3,768
    =?Utf-8?B?S2VuIENveCBbTWljcm9zb2Z0IE1WUF0=?=
    Oct 7, 2004
  3. msnews.microsoft.com

    How to Create Web Controls using ASP.NET Controls ?

    msnews.microsoft.com, Apr 27, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    6,215
    msnews.microsoft.com
    Apr 27, 2005
  4. Hal Vaughan
    Replies:
    11
    Views:
    1,081
    Gordon Beaton
    May 22, 2006
  5. Jaime Stuardo

    How to create HTML controls a runtime

    Jaime Stuardo, Jul 22, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    791
    Jaime Stuardo
    Jul 22, 2005
Loading...

Share This Page