RE: Adding Controls to a Page 2005-02-18 - By Peter Brunone
In fact, you can use any control that has a Controls collection, which is most of the classes in the System.Web.UI.WebControls namespace. Download Reflector ( http://www.aisto.com/roeder/dotnet ) to browse all the classes, their attributes, and their relevant documentation.
-----Original Message----- From: Sonu Kapoor [mailto:sonukapoor@(protected)]
You can also use a PlaceHolder. Something like this:
Label lbl = new Label; lbl.Text = "test";
placeholder.controls.add(lbl);
-- Sonu Kapoor
On Fri, 18 Feb 2005 18:11:20 -0500, James Shaw <james@(protected)> wrote: > Usually you have a container like an <asp:panel> or <asp:literal> on > the page, and then add controls to it with .Controls.Add() from > codebehind > > Best regards, > James Shaw > 2005 Microsoft MVP ASP.NET > www.CoverYourASP.NET > Blogging on ASP.NET > www.CoverYourASP.com > Download it. Run it. Learn it. > www.DozingDogs.com > Over 50 million pages served > > > -----Original Message----- > From: Boudreau, Duane [mailto:BoudreauD@(protected)] > > Using C#, is there a way to dynamically add controls (labels, > textboxes, > etc) to a page in its code behind page? > > If so can someone point me to a tutorial or some sample code? > > Thanks, > Duane
Need SQL Advice? http://sqladvice.com Need RegEx Advice? http://regexadvice.com Need XML Advice? http://xmladvice.com
|
|