Link to home
Start Free TrialLog in
Avatar of sbornstein2
sbornstein2

asked on

Forms Authentication App - Need User Identity from the start Help!

Hello all,

I have an app that uses forms auth that was working fine on my localhost but of course when I place it out on IIS no dice.   I have a home page the user hits in the site under the root where the web.config lives as well of course that uses forms auth.  In the home page I need to check if the user is a certain type then redirect based on if they are.  I was trying to use:

Request.ServerVariables["LOGON_USER"]

But that does not work of course it's empty.  So how can I do this either off a global.asax session start or whatever I need to do.  I am really hoping I don't have to pull out the redirect pages and code from this main app as I want it to live there.  I somehow need the user identity.
ASKER CERTIFIED SOLUTION
Avatar of Alan Warren
Alan Warren
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,

Context.User.Identity.Name should solve your problem!

Check the MSDN article - http://msdn.microsoft.com/en-us/library/xdt4thhy(v=vs.100).aspx

Hope it helps u...
Avatar of sbornstein2
sbornstein2

ASKER

thanks