Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding control on a page
Message
De
11/11/2010 05:50:22
 
 
À
10/11/2010 14:02:50
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01488738
Message ID:
01488788
Vues:
37
>Actually, this works. What I meant was adding some code like this but expecting the control in it to be ASP.NETized:
>
>
>        ' Find the control to hold the customized page
>        loControl = Page.FindControl("LabelDataEntry")
>
>            loControlLabel2 = New System.Web.UI.WebControls.Label
>            loControlLabel2.Text = "<tr>" + _
>             "<td class=""Label""><asp:Label ID=""LabelGenericEntity"" runat=""server""></asp:Label>:</td>" + _
>             "<td><img src=""Images/point.gif"" width=3 height=1 /></td>" + _
>             "<td><asp:DropDownList ID=""NoEntity"" runat=""server"" Width=300></asp:DropDownList>" + _
>             "</tr>"
>            loControlLabel.Controls.Add(loControlLabel2)
>
>
>...and, hoping for NoEntity to be seen after with:
>
>
>loControl = Page.FindControl("NoEntity")
>
Where is this code executing?
You can use the technique to create HTML objects in the browser but NOT asp.net controls - they just end up in the browser as an unknown element.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform