Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Initialization of a Web User Control inside Repeater Control

Reply
Thread Tools

Initialization of a Web User Control inside Repeater Control

 
 
satyajit
Guest
Posts: n/a
 
      08-21-2007
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?

 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      08-21-2007
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: oups.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?
>



 
Reply With Quote
 
 
 
 
satyajit
Guest
Posts: n/a
 
      08-21-2007
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" <satyajit...@gmail.com> wrote in message
>
> news: oups.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?



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing USER CONTROL which is inside Masterpagethrough Another USER Control inside normal page. Kiran More ASP .Net Web Controls 2 11-14-2006 12:58 PM
repeater inside a repeater problem. uncensored ASP .Net 0 10-25-2006 06:10 PM
Repeater inside a Repeater Microsoft ASP .Net Web Controls 0 08-21-2006 09:13 AM
How do you use a user control as a template inside a repeater? fernandezr ASP .Net 8 07-07-2006 02:28 PM
Repeater inside a repeater....how? voidfill3d@yahoo.com ASP .Net 1 08-10-2005 01:58 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57