DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 21 Aug 2007 13:12:04 -0000,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    satyajit
          2    Cowboy \(Gregory A. Beamer\) oSpamM
          3    satyajit


Initialization of a Web User Control inside Repeater Control   
I am working on an application that has a Web User Control contained
within <ItemTemplate> of a Repeater control. The Web User Control has
a public property that needs to be assigned in order to work correctly
(the web user control uses this object to initialize DataSource of
some of its child controls). Is it correct to use Repeater's
ItemCreated event to assign value to the above mentioned public
property? If not, what are the alternatives?

I also want to know at which stage of life-cycle of the contained Web
User Control, the ItemCreated event of the repeater control will be
invoked?
Date:Tue, 21 Aug 2007 13:12:04 -0000   Author:  

Re: Initialization of a Web User Control inside Repeater Control   
Or you can expose a public (or internal?) property on the user control and 
set it using the normal Eval() to pull data and set the property with it. 
Provided, of course, the setting is in the data you are binding to the 
repeater.

When you think of user controls as black boxes, much like other controls, 
you find you can treat them the same way.

-- 
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box! 
|
*************************************************
"satyajit"  wrote in message 
news:1187701924.691549.161990@a39g2000hsc.googlegroups.com...

>I am working on an application that has a Web User Control contained
> within <ItemTemplate> of a Repeater control. The Web User Control has
> a public property that needs to be assigned in order to work correctly
> (the web user control uses this object to initialize DataSource of
> some of its child controls). Is it correct to use Repeater's
> ItemCreated event to assign value to the above mentioned public
> property? If not, what are the alternatives?
>
> I also want to know at which stage of life-cycle of the contained Web
> User Control, the ItemCreated event of the repeater control will be
> invoked?
> 
Date:Tue, 21 Aug 2007 09:13:01 -0500   Author:  

Re: Initialization of a Web User Control inside Repeater Control   
On Aug 21, 4:13 pm, "Cowboy \(Gregory A. Beamer\)"
<NoSpamMgbwo...@comcast.netNoSpamM> wrote:

> Or you can expose a public (or internal?) property on the user control and
> set it using the normal Eval() to pull data and set the property with it.
> Provided, of course, the setting is in the data you are binding to the
> repeater.


okay.

However, if for some reason, it's not possible to do it in the markup,
we would need to use ItemCreated event. Correct?


> When you think of user controls as black boxes, much like other controls,
> you find you can treat them the same way.


My trouble is that the user control has used the property (in
question) in its OnInit event. Is it guaranteed that OnInit of user
control will be called after ItemCreated event of parent repeater
control? This is not clear in MSDN documentation for "ASP.NET Page
Life Cycle Overview" <http://msdn2.microsoft.com/en-us/library/
ms178472.aspx>.

Thanks.
- Satyajit

"satyajit"  wrote in message

>
> news:1187701924.691549.161990@a39g2000hsc.googlegroups.com...
>
> >I am working on an application that has a Web User Control contained
> > within <ItemTemplate> of a Repeater control. The Web User Control has
> > a public property that needs to be assigned in order to work correctly
> > (the web user control uses this object to initialize DataSource of
> > some of its child controls). Is it correct to use Repeater's
> > ItemCreated event to assign value to the above mentioned public
> > property? If not, what are the alternatives?
>
> > I also want to know at which stage of life-cycle of the contained Web
> > User Control, the ItemCreated event of the repeater control will be
> > invoked?
Date:Tue, 21 Aug 2007 15:03:36 -0000   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us