1

I have a MVC application where i have used jquery for service calls and displaying in the views. I am planning to add call to authentication in the layout page, but if user directly calls the partial view page, authentication will not call at all.

user5050407
  • 85
  • 1
  • 9

1 Answers1

1

I am not totally understanding what you are trying to do with the Layout file, but you can decorate your Action methods with [ChildActionOnly] to prevent the user from being able to navigate to them directly. See: Using ChildActionOnly in MVC

Community
  • 1
  • 1
stephen.vakil
  • 3,492
  • 1
  • 18
  • 23