setting a variable in one UC for another UC to read

  • Thread starter Thread starter Darrel
  • Start date Start date
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
 
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.
 
Back
Top