如何使用电子邮件作为httpcontext.User.Identity.name [英] How to use email as httpcontext.User.Identity.name
问题描述
我正在制作新的asp.net MVC3的应用程序中,用户表,我不希望有用户名,但只有用户ID(长)和电子邮件(字符串)。
我想明白通常当我用正常的DB结构成员提供,我在DB的User.Identity.Name获取用户名值。
I'm creating a new asp.net MVC3 app in which in user table I do not wish to have user name but only user id (long) and email (string). What I would like to understand is normally when I use membership provider with normal db structure, I get the username value in db as the User.Identity.Name.
可能有人请告诉我,我需要什么样的变化做,因为我不会在我的分贝任何用户名,以确保我的电子邮件地址与我的User.Identity.Name
Could someone please tell me what changes I need to do as I will not have any username in my db to ensure that my email address becomes my User.Identity.Name
谢谢
ARNAB
Thanks Arnab
答:发现了...它FormsAuthentication.SetAuthCookie决定哪些价值去user.identity.name
Answer: found out... its FormsAuthentication.SetAuthCookie that decides which value goes to user.identity.name
推荐答案
发现...它FormsAuthentication.SetAuthCookie决定哪些价值去user.identity.name
found out... its FormsAuthentication.SetAuthCookie that decides which value goes to user.identity.name
这篇关于如何使用电子邮件作为httpcontext.User.Identity.name的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!