Nothing to do more....Just assign the username textbox value to the Session variable in the login page and access that Session variable to the master page:
Login page:
DataTable dt = Check username in the database and put in a datatable
if (dt != null && dt.Rows.Count > 0)
{
Session["UserName"] = txtUserName.Text.Trim();
Response.Redirect("/Home.aspx");
}
else
{
lblMsg.Text = "username or password invalid";
}
In the master page:
if (Session["UserName"] != null)
lblWelcome.Text = "Welcome " + Session["UserName"].ToString();
else
lblWelcome.Text = "Welcome Guest"