How to get User id after leave login page?

99 Views Asked by At

I develop asp.net Web Form application use VS2015. I used asp.net login control to identify user. How can I get the userID after the user have loged in and leave the login page?

1

There are 1 best solutions below

1
A-A-ron On BEST ANSWER

Assuming that you are using ASP.NET Identity. You should be able to access the UserID of your authenticated in user by using this.Page.User.Identity.GetUserId(). Be sure to include using Microsoft.AspNet.Identity;.