Sure, creating public properties on your master page, and use the MasterType
directive.
So in your page, if you do:
<%@ masterType VirtualPath="~/template/main.master" %>
you can then access your master's properties in a strongly-typed fashion in
your page
int userId = Master.UserId;
Karl
ur master would look soemthing like:
private int _userId;
public int UserId
{
get { return _userId; }
}
Page_Load(...)
{
_userId = (int)Session["userId"];
}
--
http://www.openmymind.net/
http://www.codebetter.com/
"Thiery Balser" <(E-Mail Removed)> wrote in message
news:44d983d0$(E-Mail Removed)...
> Hi Everybody!
>
>
> I'm stuck with the following problem:
>
> I have a couple of pages which has all the same 'header', i.e. some common
> elements. So far I realized that the best thing would be to use master
> pages. This is all fine and works.
>
> Now, there are certain variables stored in the session object which I
> would like to use in the other pages. What I would like to do is to
> initialize the variables, assign values to them in the Page_Load of the
> MasterPage and then use in the other pages (outside the masterpage, i.e.,
> in the pages which use the MasterPage). Is there any smart way to do this?
>
>
>
> Thank you very much in advance,
>
>
>
> Thiery
>