Jason, the long answer to your question is:
There are 5 common state mechanism in ASP.Net which mostly vary in terms of
lifetime and scope (with some exceptions). All are very useful when used at
the right time, they are:
Application - global to all users, exist for the lifetime of the application
Cache - global to all users, exists for the lifetime of the cache duration
Session - specific to each user, exist for the lifetime of the session
timeout
Viewstate - specific to each request, exists for the lifetime of a request
and its postback
Context - specific to each request, exists for the lifetime of the request.
What you want is a sessision (or something which shares its properties such
as a cookie) because (a) the information displayed is specific to each user
(b) the lifetime of the information is as long as the user visits the site.
Here's a very basic example:
Page1.aspx -->
<script runat="server" language="vb">
Sub Page_Load
Session.Add("Name", "Jason")
End Sub
</script>
<a href="page2.aspx">page 2</a>
Page2.aspx -->
<script runat="server" language="vb">
Sub Page_Load
name.Text = cstr(session("Name"))
End Sub
</script>
<asp:literal id="name" runat="server" />
"Jason" <ja***@hotmail.com> wrote in message
news:35********************************@4ax.com...
Hi, I am new to asp.net, and here is my question:
when a user logged into a web site, then I will pull his/her name (for
example) from database, then not matter which page he/she viewed, alwasy has
his/her name displayed somewhere at those pages? Some demo code?
Thanks in advance.
ASP.NET Rookie.