开发者

display email of logged in user, aspnet forms authentication

开发者 https://www.devze.com 2023-01-18 10:17 出处:网络
i\'m using forms based authentication within my aspnet (c#) website. At the log in page i\'m capturing username, password and email. the email addressed is stored wit开发者_C百科hin the membership tab

i'm using forms based authentication within my aspnet (c#) website. At the log in page i'm capturing username, password and email. the email addressed is stored wit开发者_C百科hin the membership table. now on a new page, i'd just like to display the users' email address so they update it as well as another boolean field. i've tried using a gridview but i can't figure out how to modify the query so it only reveals the current logged in user. thanks!


Since you're using Membership controls, you could to this.

string userEmail = Membership.GetUser().Email;

If you don't pass a parameter to GetUser(), it will find the details of the currently logged in user.

MSDN doc for Email property

MSDN doc for GetUser method

0

精彩评论

暂无评论...
验证码 换一张
取 消