L
LilC
I'm creating an application that has a standard layout for all pages.
The information that is displayed in the layout will be dynamic based
on the user that is logged in. Thus when a page is browsed to, I need
to check to see if the user has logged in or not. Then if they have
logged in, I need to pull their information from the database to
display in the header.
In previous applications, I made use of a base web page that all the
content pages inherited from to check whether they were logged in and
to create a database connection. With VS 2005, I thought I'd try to
make use of the Master Page to incorporate the standard layout. But I'm
not sure of the best way to do this with the base web page
functionality and the master page combined. Do I query the database for
the user information from the Master page or the base web page class?
Also as I click on different buttons in the layout, different
information is displayed - should the Master page handle that click
event - if so, how do I get the content page to refresh according to
what they have clicked?
Also would the best route for the user information to be to collect it
the first time a user logs in and then store it in session variables so
I don't have to query the database for the user information every time?
The impression has always been that session variables are bad so I've
avoided them but are they safe with 2005 now (across multiple servers
as well).
Sorry for all the questions but I just want to make sure I'm using the
Master Page functionality in the recommended way. I've read a number of
articles from MSDN and other sites but haven't found any solid ideas
surrounding my particular implementation.
I appreciate all suggestions!
The information that is displayed in the layout will be dynamic based
on the user that is logged in. Thus when a page is browsed to, I need
to check to see if the user has logged in or not. Then if they have
logged in, I need to pull their information from the database to
display in the header.
In previous applications, I made use of a base web page that all the
content pages inherited from to check whether they were logged in and
to create a database connection. With VS 2005, I thought I'd try to
make use of the Master Page to incorporate the standard layout. But I'm
not sure of the best way to do this with the base web page
functionality and the master page combined. Do I query the database for
the user information from the Master page or the base web page class?
Also as I click on different buttons in the layout, different
information is displayed - should the Master page handle that click
event - if so, how do I get the content page to refresh according to
what they have clicked?
Also would the best route for the user information to be to collect it
the first time a user logs in and then store it in session variables so
I don't have to query the database for the user information every time?
The impression has always been that session variables are bad so I've
avoided them but are they safe with 2005 now (across multiple servers
as well).
Sorry for all the questions but I just want to make sure I'm using the
Master Page functionality in the recommended way. I've read a number of
articles from MSDN and other sites but haven't found any solid ideas
surrounding my particular implementation.
I appreciate all suggestions!