Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
this is my code to login into the application:

C#
protected void btnlogin_Click(object sender, EventArgs e)
   {

       LoginBLL objloginBLL = new LoginBLL();
       LoginModel obj = new LoginModel();
       obj.Email = Email.Text;
       obj.Password = Password.Text;
       obj.id = 0;

       obj.OrganisationID =Convert.ToInt32 (ddlorganisationname.SelectedValue);

       DataSet ds = new DataSet();
       ds = objloginBLL.logindetailsBLL(obj);


       if (ds.Tables[0].Rows.Count > 0)
       {
           if (ds.Tables[0].Rows[0]["role"].ToString() == ResourceManagementConstants.str_manager)
           {
               Response.Redirect("ManageUsers.aspx");
           }
           else
           {
               FormsAuthentication.RedirectFromLoginPage(Email.Text, false);
               Response.Redirect("FullProfile.aspx?id="+ds.Tables[0].Rows[0]["id"].ToString());

           }
           Session["OrganisationID"] = ddlorganisationname.SelectedValue;

       }
       else
       {
           ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Invalid Username and Password')</script>");
       }
       Session["lgnFlag"] = 1;

   }


here i m logged in with the email id and if the user redirects to another there his name sholud be displayed in the welcome note, as per my code i m able to get the logged in email id . how to change
Posted
Updated 15-Feb-13 19:51pm
v2

1 solution

logged in with the email id and if the user redirects to another there his name sholud be displayed in the welcome note
Your question is not too clear not is the tag. Based on my assumption that it is ASP.NET and you want to show logged in user name post logging in using an email, you need to do:
1. After autehentication, get the details of the user based on the emailID which should be unique for every user as it is being used as a username
2. Once you have details of the user, assign the needed data in your welcome note.

Try out and be more specific next time please.
 
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