In ASP.NET MVC, is it possible to limit an action to be called only through RenderAction and not from the browser?
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 cr开发者_如何学JAVAeate an IActionFilter for that.
Add the [ChildActionOnly]
attribute.
精彩评论