tags:

views:

46

answers:

2

I think Page.User.Identity.IsAuthenticated is available in ASP.NET MVC, because I see other people talking about using it.

However, when I type Page., the intellisense gives me only these 3 options :

CreateHtmlTextWriterFromType Equals ReferenceEquals

What do you think is going on?

EDIT: If I do Page page = new Page(), then page.User works. Is it really needed?

A: 

Page is a Webforms object, not much help in MVC. You can access the authenticated user from the HTTP Context, something like httpcontext.user.identity

AUSteve
current is missing too
progtick
where are you trying to use it, more code would help
AUSteve
+1  A: 

You can access it in Controller :HttpContext.User.Identity.IsAuthenticated You can acces it in view like this :<% if(User.Identity.IsAuthenticated){} %> Hope this helps.

ali62b
And from a master page you can use Context.User.Identity.IsAuthenticated
David G
Thanks Dave for completing.+1
ali62b