Sharing data between Page and UserControl

J

Jason

I've attempted a few different methods for sharing data between a User
Control and the Page in which it resides, but none seem to work.

The UserControl loads some data in the Page_Load method, populates
private data members and provides access to the data via public
properties.

The Page registers the control in the ASPX and I'd like it to
interrogate the UserControl for its data prior to display.

I think the fact that I want to do all this during loading is causing
me problems.

I've tried:
UserControl to Page communication (null values)
Page to UserControl communication (null values)
Events (complains about null reference)

Can these two objects communicate when I need them to (before display)
and, if so, what's the best way?

I've been using the following as references:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcwlkEventsTutorial.asp
http://www.openmymind.net/communication/

Thanks,
Keith
 
T

TC

I beieve this can only be done via public variables / properties or via a
query string.

TC
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top