Article View: borland.public.delphi.aspdotnet.components.using
Article #205Re: Adding webcontrols at running time
From: Ivan Revelli
Date: Tue, 11 Oct 2005 09:32
Date: Tue, 11 Oct 2005 09:32
37 lines
1933 bytes
1933 bytes
Hi,
only a little adding, if you want to assign a method to a button for
example you need to write a method and use Include(<>,<>) directive to
assigne the event andler.
bst rgds
Ivan
info@csdrevelli.it
http://www.csdrevelli.it
"Marco Caspers" <hexor_haxor@vaxor.com> ha scritto nel messaggio
news:43214254@newsgroups.borland.com...
> Fabricio Vargas Matos wrote:
>
> > Can I instantiate a new webcontrol (a TextBox, for example) at
> > runtime?
> > I would like to do something like:
> > TextBox := System.Web.UI.WebControls.TextBox.Create;
> > TextBox.Page := self;
> > ...
> > and have a new TextBox in the web page.
>
> Yup, easy, almost like you did:
>
> TextBox := WebControls.TextBox.Create();
> Self.Page.Controls.Add(TextBox);
>
> > But, of course, there ins't any reference of this TextBox in the aspx
> > file, so....
> Not a problem, as long as you add it to the controls list.
>
>
> Hth,
> Marco.
Technical Details
Message-ID:
<434b8456$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<4321238a@newsgroups.borland.com> <43214254@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 21665a,f252a3da4b2c687a X-Google-Attributes: gid21665a,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Ivan Revelli" <info@csdrevelli.it> From: "Ivan Revelli" <info@csdrevelli.it> Newsgroups: borland.public.delphi.aspdotnet.components.using References: <4321238a@newsgroups.borland.com> <43214254@newsgroups.borland.com> Subject: Re: Adding webcontrols at running time Date: Tue, 11 Oct 2005 11:32:02 +0200 Lines: 39 Organization: c.s.d. di revelli ivan X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 NNTP-Posting-Host: 217.133.27.133 Message-ID: <434b8456$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1129022550 217.133.27.133 (11 Oct 2005 02:22:30 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail