Question regarding user controls

G

Guest

Hi

I have a control (child2.ascx). Which I place in a repeater in another
controls (child1.ascx). Child2.ascx is again placed in a repeater on a
Page(Page1.aspx).

What will be a good way to pass some properties? For example on Page1.aspx I
have a variable '_isAdmin'. Based on this variable I want to initialize
'_isAdmin' variables in both child controls.

How should I do this?

Thanks in advance.
 
G

Guest

If you make a public IsAdmin Property (not a public field -- a real property)
then you can set this property either programmatically or declaratively in
the markup. You can even provide an overloaded ctor that accepts and sets the
value.
Peter
 
G

Guest

Thanks for your response.

I can do through Markup for the Child1.ascx (embeded in the .aspx page). But
I'm running into problems trying to do the same thing in markup of
Child2.ascx which is embeded in Child1.ascx. If I hardcode 'true' in
child2.ascx it would work.

Seems to be because sequence of different events. Still trying to figure out.

Thnx.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top