Ask a Question related to ASP.NET General, Design and Development.
-
poi #1
Which ASP.NET Controls Have Child Controls?
In VS.NET 2003, I get intellisense if I do this:
LiteralControl literalControl = new LiteralControl();
literalControl.ID = "something";
literalControl.Controls.Add.....
And it compiles fine but I get an error saying that the LiteralControl
does not allow child controls.
So which controls *do* allow children, since VS.NET is not helping me?
Thanks.
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
poi Guest
-
Control.Controls bug? Control's child controls missing at the run time.
Hello, ..NET 1.1/VB.NET: I have a custom web control Public Class DatePicker Inherits Control Implements INamingContainer -
HELP! Child controls of child controls not visible to web app
I have a custom server control. It's a TabControl. It's really cool, actually. Looks just like a standard VB6 TabControl. It lets you set the... -
Getting id of composite child controls
I can't seem to get the id of the child controls of my composite control. I can get the unique id but the id when I try to access it via the... -
user controls: dynamiclly added child controls dont survive post back ?
hi, i have some strange behaviour: i've created a web user control that add's some child controls (e.g: textbox, image buttons) to its control... -
Accessing Properties of Custom Controls child Controls
I am using a Custom Control on a page which renders a button control if required. I need to access the child button control's properties (i.e.... -
Marina #2
Re: Which ASP.NET Controls Have Child Controls?
The problem is, LiteralControl inherits from a class that has a Controls
property - so LiteralControl inherits it as well.
Container controls such as a Panel, PlaceHolder, and others have a Controls
collection you an manipulate.
Controls such as TextBox, Button, etc don't - and this just makes sense. A
button cannot have any controls within it - it is a button!
You just have to think about whether or not it really makes sense for a
control to have child controls.
"poi" <ddvsv12@rucs.nul> wrote in message
news:%233F5wlEWDHA.2164@TK2MSFTNGP09.phx.gbl...>
>
> In VS.NET 2003, I get intellisense if I do this:
>
> LiteralControl literalControl = new LiteralControl();
> literalControl.ID = "something";
>
> literalControl.Controls.Add.....
>
> And it compiles fine but I get an error saying that the LiteralControl
> does not allow child controls.
>
> So which controls *do* allow children, since VS.NET is not helping me?
>
> Thanks.
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
Marina Guest
-
Kevin Spencer #3
Re: Which ASP.NET Controls Have Child Controls?
That's a darned good question. I am just guessing here, but I would suspect
that any control which renders a tag can have Controls added to it. The
reason I believe this is that adding a Control to the Controls Collection of
a Server Control appends the child Control HTML in between the starting and
ending tags of the parent Control. A LiteralControl can be plain text,
without any tag at all. I suspect that this is why you can't add Controls to
its' Controls Collection. I would love to hear an authoritative answer to
this question, though.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
[url]http://www.takempis.com[/url]
Complex things are made up of
lots of simple things.
"poi" <ddvsv12@rucs.nul> wrote in message
news:%233F5wlEWDHA.2164@TK2MSFTNGP09.phx.gbl...>
>
> In VS.NET 2003, I get intellisense if I do this:
>
> LiteralControl literalControl = new LiteralControl();
> literalControl.ID = "something";
>
> literalControl.Controls.Add.....
>
> And it compiles fine but I get an error saying that the LiteralControl
> does not allow child controls.
>
> So which controls *do* allow children, since VS.NET is not helping me?
>
> Thanks.
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
Kevin Spencer Guest
-
Bill Priess #4
Re: Which ASP.NET Controls Have Child Controls?
And a good case in point... don't always rely on the grossly overrated
Intellisense.. ;)
Bill P.
On Fri, 01 Aug 2003 09:24:52 -0700, poi <ddvsv12@rucs.nul> wrote:
>
>
> In VS.NET 2003, I get intellisense if I do this:
>
> LiteralControl literalControl = new LiteralControl();
> literalControl.ID = "something";
>
> literalControl.Controls.Add.....
>
> And it compiles fine but I get an error saying that the LiteralControl
> does not allow child controls.
>
> So which controls *do* allow children, since VS.NET is not helping me?
>
> Thanks.
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
>
--
Using M2, Opera's revolutionary e-mail client: [url]http://www.opera.com/m2/[/url]
Bill Priess Guest



Reply With Quote

