开发者

how to run if(!User.IsAuthenticated) or access Profile.values in App_Code? c# .NET

i'm trying to run a conditional statement in a class i'm placing in my App_Code folder

the condition is whether the person is logged in or not. I normally have two w开发者_运维百科ays to do this in my masterpage and ASPX's

if (!User.IsAuthenticated) or if(Profile.username = "anonymous")

however neither of these things seem available to me in the .cs i'm making. anyone know what i'm missing? maybe a using namespace up top?


Change it to HttpContext.Current.User and HttpContext.Current.Profile.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜