PAGE.USER missing in ASP.NET MVC?

I think the ASP.Identity.IsAuthenticated page is available in ASP.NET MVC because I see other people talking about using this.

However, when I print the page., Intellisense gives me only these 3 options:

CreateHtmlTextWriterFromType Equals ReferenceEquals

What do you think is going on?

EDIT: if I execute Page page = new Page(), then it page.Userworks. Is it really necessary?

+3
source share
2 answers

You can access it in the controller: HttpContext.User.Identity.IsAuthenticated You can use it like this: <% if(User.Identity.IsAuthenticated){} %> Hope this helps.

+4
source

Page - Webforms, MVC. HTTP, - httpcontext.user.identity

+1

Source: https://habr.com/ru/post/1730649/


All Articles