Forms Authentication and login name

Y

yossimotro

Hi guys,

I'm now rebuilding my website to work in forms authentcation instead of
windows' authentication as it used to be.

When I had windows authentication I used the login name to perform some
db operations, I retrieved it by using
Request.ServerVariables["LOGON_USER"].
I know forms authentication has a "login name" control but I need to
get the name from the code itself.

Any suggestions?

Thanks,
Yossi.
 
Y

yossimotro

Hi again,

I think I've found the way to do it if anyone is interested:
HttpContext.Current.User.Identity.Name
It'll give you the username.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top