Decorate Controller Actions with [ChildActionOnly]
/In the controller:
[ChildActionOnly]
[OutputCache(Duration=2000)]
public ActionResult TagsForPost(int postId) {
return View();
}
Notice the
ChildActionOnly attribute. From MSDN:Any method that is marked withChildActionOnlyAttributecan be called only with theActionorRenderActionHTML extension methods.
This means people can’t see your child action by manipulating the URL (if you’re using the default route).
No comments:
Post a Comment