Click here to Skip to main content
15,897,226 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
If a user logged in, the user's full name from database must be in the label or after the word.

Example: Welcome [Firstname Lastname]!.

What are the codes for generating it using class library? I hope you can help me. Thanks!
Posted
Comments
Sergey Alexandrovich Kryukov 26-Nov-12 20:33pm    
What have you done so far?
--SA
esonparedes 26-Nov-12 20:37pm    
--------------------------
protected void Page_Load(object sender, EventArgs e)
{
if (Session["user"] != null)
{

Label1.Text = Session["user"].ToString();
}
else if (Session["user"] == null)
{
Response.Redirect("Homepage.aspx"); //This my Login Page
}
}
--------------------------

I've done that code. but only the username selected is used. I'm trying to know what is the correct code for it. Thanks and Regards!

1 solution

C#
foreach(DataRow dr in Users.Rows)
{
   UserName.Text=dr["firstName"].ToString() + dr["lastName"].ToString();
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900