access controls on another web user control

G

Giorgio

I have 2 web users controls in a page and I would like to get or set
the selected values of a few dropdown boxes and I also would like to
know how to access functions that are on aweb user control X from a web
user control Y, is this possible? How can I do it?
 
C

chris

For the first part, just make some public properties of your controls.
public TextBox TextBox1
{
get { return t1; }
set { t1 = value; }
}

Where t1 is the ID of your control. Then this control and all its
properties can be accessed from your web form.

As for the second part of the question, I don't think you can access
methods from one user control to another. I think they took this
ability away in 2.0 because it was tightly coupling user controls.
What I do is I use the Web form calling the user controls as the
middleman and have him take care of communicating data between the two
user controls.

HTH,
Chris
 

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,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top