如何更改电子邮件如果要命名? [英] how to change from email if to name?

查看:543
本文介绍了如何更改电子邮件如果要命名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我登录应用程序的代码:



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;

   }





这里我使用电子邮件ID登录,如果用户重定向到另外,他的名字sholud将显示在欢迎注释中,根据我的代码我能够获取登录的电子邮件ID。如何更改



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

推荐答案

使用电子邮件ID登录,如果用户重定向到另一个,那么他的名字sholud将显示在欢迎注释中

您的问题不太明确不是标签。基于我的假设,它是ASP.NET,并且您希望在使用电子邮件登录后显示登录的用户名,您需要这样做:

1.在身份验证后,获取用户的详细信息基于emailID,对于每个用户都应该是唯一的,因为它被用作用户名

2.一旦掌握了用户的详细信息,请在欢迎笔记中分配所需的数据。



下次请试试并更具体。
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.


这篇关于如何更改电子邮件如果要命名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆