Generating webcontrols in runtime

Discussion in 'ASP .Net Web Controls' started by Annick Van Hoof, Feb 16, 2004.

  1. Hi,

    I would like to make an ASP.NET page that dynamically obtains information
    form a database and creates an input screen on the fly. This would mean I
    would need a way to create ASP.NET webcontrols on the fly.

    Could this be done ? If so, how ? Has anyone an example to do this ?

    Thanks in advance,

    Annick
    Annick Van Hoof, Feb 16, 2004
    #1
    1. Advertising

  2. Annick Van Hoof

    Yuri Belenky Guest

    You could choose the following way:
    At the ASPX page


    <%if (EditBoxRequired()){%>
    <asp:TextBox id="TextBox1" style="Z-INDEX: 101; LEFT: 544px; POSITION:
    absolute; TOP: 136px"
    runat="server"></asp:TextBox>
    <%}%>


    And EditBoxRequired() function at the code behind. You could check you
    database in this function and check do you need this editbox. Do not miss
    that this function should be marked public


    "Annick Van Hoof" <> wrote in message
    news:...
    > Hi,
    >
    > I would like to make an ASP.NET page that dynamically obtains information
    > form a database and creates an input screen on the fly. This would mean I
    > would need a way to create ASP.NET webcontrols on the fly.
    >
    > Could this be done ? If so, how ? Has anyone an example to do this ?
    >
    > Thanks in advance,
    >
    > Annick
    >
    >
    Yuri Belenky, Feb 16, 2004
    #2
    1. Advertising

  3. Annick Van Hoof

    Joe Guest

    Use Page.Controls.Add([standaradcontrol])..... or for ascx's use
    Page.LoadControl("[yourcontrol.ascx"])....

    Joe


    "Annick Van Hoof" <> wrote in message
    news:...
    > Hi,
    >
    > I would like to make an ASP.NET page that dynamically obtains information
    > form a database and creates an input screen on the fly. This would mean I
    > would need a way to create ASP.NET webcontrols on the fly.
    >
    > Could this be done ? If so, how ? Has anyone an example to do this ?
    >
    > Thanks in advance,
    >
    > Annick
    >
    >
    Joe, Feb 17, 2004
    #3
    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. Replies:
    4
    Views:
    450
    Nigel Wade
    Mar 10, 2006
  2. Hal Vaughan
    Replies:
    11
    Views:
    1,105
    Gordon Beaton
    May 22, 2006
  3. Markus Schickler

    Generating Enumeration Types at runtime

    Markus Schickler, May 4, 2007, in forum: Java
    Replies:
    5
    Views:
    519
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=
    Jun 9, 2007
  4. PauloFor

    WebControls in Runtime

    PauloFor, Jul 10, 2003, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    118
    Jenny
    Jul 31, 2003
  5. Stodge
    Replies:
    2
    Views:
    555
    Stefan Behnel
    Feb 17, 2012
Loading...

Share This Page