Click here to Skip to main content
15,920,005 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How do I display the name of a user who logged in to another.
Posted
Comments
Salman622 29-Nov-13 6:04am    
Is it web or window application
Member 10423955 29-Nov-13 6:06am    
windows application
Salman622 29-Nov-13 6:11am    
wait a minute i have code i have to search
Nelek 29-Nov-13 6:11am    
Don't think we can read minds or do astral projections to see your monitor. If you need help, the least you could do is to add some relevant code to your question or to explain your problem in such a way, that the users of CP can understand it. Otherwise, nobody will be able to help you.

Please use the "improve question" and add relevant information or a piece of code envolved. There are thousands of ways to screw things up, how are we supposed to know which one did you choose?

You can read: What have you tried?[^] and How to ask a question?[^]

add class in your solution



as below:

Using statements;

class User
{
public static string UserName="";
public User()
{
}
}


then at time of loggin click
if loggin successfully but before transferring to other page

create user class Object as:


User Uid=new User();
Uid.UserName=UserName.Text;
//UserName.Text is the user Text Box



then at the time of dash board loading
again create the object of User Class
and assign the UserName as Below:


User Uid=new User();
DashboardTextbox.Text=Uid.UserName;
 
Share this answer
 
Comments
Nelek 29-Nov-13 7:02am    
If you need to add or change content to your question or a previous solution, please use the "improve question / solution" instead of writing a lot of messages. It will keep readability and help other users with similar problems to find it faster.
if it is an web application then do as follow


1. as the user logged in assign the value of user name to session
2. at the time of dashboard loading assign that session value to textbox text
 
Share this answer
 
HttpContext.Current.User.Identity.Name;
 
Share this answer
 
v2

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