Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Masterpage
this is my code to login into the application:
 
 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 15-Feb-13 20:31pm
Edited 15-Feb-13 20:51pm
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  

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

  Print Answers RSS
0 Marcin Kozub 330
1 OriginalGriff 256
2 Sergey Alexandrovich Kryukov 215
3 Praneet Nadkar 197
4 Richard MacCutchan 182
0 OriginalGriff 8,048
1 Sergey Alexandrovich Kryukov 7,287
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,910


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 16 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100