setting a variable in one UC for another UC to read

D

Darrel

Is it possible to set a variable in one UserControl that another UserControl
can read?

For example:

page.aspx
navigationControl.ascx
pageBanner.ascx

the navigation control builds a menu by transforming some XML for me. Based
on some data stored in the XML file, I'd like to set a variable. I'd then
like pageBanner.ascx to read that variable and perform some logic based on
that.

The alternative is for me to have pageBanner process that same XML file, but
that obviously seems redundant, so I'm hoping theres a way to do the former.

-Darrel
 
S

Scott Allen

One way to communicate across pages and user controls is to use the
Context.Items collection. It is similar to the Session collection
except it is only around for the duration of a single request.
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top