开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜