Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Web controls within web controls?


Message #1 by "Oliver, Wells" <WOliver@l...> on Wed, 10 Jul 2002 15:50:17 -0700
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C22864.295C7140
Content-Type: text/plain;
	charset="iso-8859-1"

I have a Repeater control with an id of "repMessages". I'd like to stick a
label control (id "returnLink") w/in the footer template of repMessages.

Can this be done? I keep getting compiler errors "Object reference not set
to an instance of an object". This is because, I assume, i have my label
control specified w/in the Repeater control.

Thanks for any information!

Wells Oliver
Web Application Programmer
Leviton Voice & Data
xxx-xxx-xxxx
http://www.levitonvoicedata.com 

Message #2 by Feduke Cntr Charles R <FedukeCR@m...> on Thu, 11 Jul 2002 09:13:46 -0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C228DC.CA1316C0
Content-Type: text/plain;
	charset="iso-8859-1"

    If you put a web control within a container, you can access it by doing:
 
Label l = (Label)(yourReapeater.FindControl("yourLabelId"));
 
    This seems to work pretty consistently for me, but obviously there's
some kind of performance hit with .FindControl (whether or not it really
matters when you're using .NET to develop anything is the question).
 
- Chuck

-----Original Message-----
From: Oliver, Wells [mailto:WOliver@l...]
Sent: Wednesday, July 10, 2002 6:50 PM
To: ASP+
Subject: [aspx] Web controls within web controls?



I have a Repeater control with an id of "repMessages". I'd like to stick a
label control (id "returnLink") w/in the footer template of repMessages.

Can this be done? I keep getting compiler errors "Object reference not set
to an instance of an object". This is because, I assume, i have my label
control specified w/in the Repeater control.

Thanks for any information! 

Wells Oliver 
Web Application Programmer 
Leviton Voice & Data 
xxx-xxx-xxxx 
http://www.levitonvoicedata.com <http://www.levitonvoicedata.com>  

--- Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to  



  Return to Index