Skip to content
Loading
Page only accessible if user is logged in
0
  • Sachin Singh
    we have Authorize[] attribute , which prevents anonymous users to access page .
    1. [Authorize]  
    2. public ActionResult GetAll()  
    3. {  
    4. return view();  
    5. } 
     For Roles based access
     
    1. [Authorize(Role="Admin,Editor")]    
    2. public ActionResult GetAll()    
    3. {    
    4. return view();    
    5. }   
    0