[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webcontrols

Generating webcontrols in runtime

Annick Van Hoof

2/16/2004 11:47:00 AM

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


2 Answers

Yuri Belenky

2/16/2004 2:35:00 PM

0

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" <me@here.nospam> wrote in message
news:ukv6RKI9DHA.2676@TK2MSFTNGP10.phx.gbl...
> 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

2/17/2004 12:27:00 AM

0

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

Joe


"Annick Van Hoof" <me@here.nospam> wrote in message
news:ukv6RKI9DHA.2676@TK2MSFTNGP10.phx.gbl...
> 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
>
>