You need to make the members public on the Master page. So in the Master
code (either inline in .master in <script runat=server> or in codebehind:
string _address;
public string UserAddress
{
get { return _address; }
}
But given whet you described, I'd suggst doing it differently. Instead consider
just having a seperate class (perhaps in App_Code) with all static methods/properties
like "CurrentUserAddress" that does the lookup dynamically (based upon HttpContext.Current.User.Identity.Name)
and caches the results in the ASP.NET data Cache. This was any page, control
or master can call into the API and you're ont dependant upon using a particular
master page to do this work.
-Brock
DevelopMentor
http://staff.develop.com/ballen Hi,
I have given this a go but I am still having problems with my code
generated variables. I have a master page that checks the
authenication
ticket to see who is logged in. I then want to store the information
about
the logged in user in variables. the content pages then need to be
able to
access the variables to enable the content pages to change based ono
the
logged in user details.
Can I make this happen and if so How do I do it.
Thanks
Kenneth
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:11***********************@msnews.microsoft.co m...
You should add the <%@ MasterType VirtualPath="YourMaster.master" %>
to
your
ASPX pages.
http://beta.asp.net/QUICKSTART/aspne...efault.aspx#co
de
-Brock
DevelopMentor
http://staff.develop.com/ballen Hi,
I have a Masterpage that controls the basic layout of the pages
displayed
on a web site. The masterpage also uses some variables. I would like
to be
able to access some of these variables from the content pages. Can
this be done and if so how. I have made the Varibles that I wish to
access Public Members.
Thanks for any help.
Kenneth