using master page
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.
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?
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
精彩评论