c# - _start.cshtml view is not executing -


i using asp.net mvc-4 in application. have created controller, eample person , in controller have 3 actions example getname, getage , getdateofbirth. want place check user not loggedin can't access these action view.

for trying use _start.cshtml view. placed inside views/person/ , expecting whenever user access view inside person folder _start.cshtml view should run before other view. , in *_start.cshtml* placed code check whether current user logged in or not. _star.cshtml not executing.

can please tell me doing wrong ?

now want place check user not loggedin can't access these action view

that's absolutely not should done in views on controller actions, decorating them [authorize] attribute. example:

[authorize] public actionresult someaction() {     ... } 

and have possibility specify 1 or more roles:

[authorize(roles = "admin")] public actionresult someaction() {     ... } 

you decorate controller attribute mean actions in require authorization.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -