I have some partial views in my controller. The problem is that users can visualize my partial views if they are placed in the URL: (www.mydomain.com/mycontroller/mypartialview). How can I deny direct access ... and only allow partial views from the base view?
Thank you in!
add [ChildActionOnly] .. like this:
[ChildActionOnly] public PartialViewResult List(Model model) {... return PartialView(model); }
As Andras says, this will only happen if you have a controller action to return them. I see that you can have those on which you should add an attribute (filter them) as [ChildActionOnly]