I am using Login Control available in ASP.NET 2.0 in the login page. Once the user is authenticated successfully against database, I am redirecting the user to home.aspx. Here,
One good place for that kind of data would be in session. Try something like this on the first page:
this.Session["UserName"] = userName;
and then subsequent pages in that session for that user could access this.Session["UserName"].
The best thing to do though is to create a static class to manage Session for you like so:
using System;
using System.Web;
static class SessionManager
{
public static String UserName
{
get
{
return HttpContext.Current.Session["UserName"].ToString();
}
set
{
HttpContext.Current.Session["UserName"] = value;
}
}
// add other properties as needed
}
Then your application can access session state like this:
SessionManager.UserName
This will give you maximum flexibility and scalability moving forward.