I have some actions that are only called from Html.RenderAction and I’d like to prevent these actions from being called directly using a URL.
Is it possible to see that the current request was made from a call to RenderAction? In that case I could create an IActionFilter for that.
Add the
[ChildActionOnly]attribute.