Reputation: 22321
I have master page in asp.net.i want to display user in master page but in my knowledge master page is loading once at a time.How it possible when Session["User"] only get when login attempt.But master page is already loaded.
Upvotes: 1
Views: 118
Reputation: 6446
try to put a breakpoint in pageload of aspx.cs and master page. Page will load first. and after that master page will load. So session added from page can be accessible form masterpage
Upvotes: 0
Reputation: 219077
The master page renders with each page request, so if you have code that dynamically populates data on the page (for example, setting a label in Page_Load) it will populate on each subsequent page load. A master page can read from Session values just fine.
Have you tried something specific and it's not working?
Upvotes: 3