Rouchie
asked on
Name 'User' is not declared
I need to refer to User.Identity.Name within a class in the App_Code folder. When I use User.Identity.Name I get an error saying
Name 'User' is not declared
Can anyone tell me the correct syntax for reading this value? Thank you.
Name 'User' is not declared
Can anyone tell me the correct syntax for reading this value? Thank you.
That is the correct syntax.
ASKER
Sorry, then how do I retrieve the value usually returned when my normal pages read this? The value is set originally using forms authentication in global.asax.
From that point on every page can access user.identity.name no problem, however, within this class I get the error above. I'm sure I need to do something else to reference it, but aren't sure what...
From that point on every page can access user.identity.name no problem, however, within this class I get the error above. I'm sure I need to do something else to reference it, but aren't sure what...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That's the one!
Thank you! :-D
Thank you! :-D