check if user is logged in in user control Asp.net MVC

前端 未结 4 834
情话喂你
情话喂你 2020-12-29 19:35

how can i check if a user is logged in in user control with asp.net mvc

usually on a view page i use this

<% if (User.Identity.IsAuthenticated)          


        
4条回答
  •  难免孤独
    2020-12-29 20:00

    Nothing new to add to Griegs answer, but I would normally do

    @Request.IsAuthenticated
    

提交回复
热议问题