Action Filters and ViewResults 

Action filters are defined in the MVCControlsToolkit.ActionFilters namespace, while ViewResults are defined in the MVCControlsToolkit.Controller namespace.

AcceptViewHintAttribute  . If an Action method is decorated with the AcceptViewHint Action Filter, and it is passed a parameter named ViewHint either as route parameter or has post parameter, it uses the string passed as PartialView name. This way a master view can decide what PartialView be used by a child Action enhancing the re-usability of child actions. To prevent attacks of malicious users this name is truncated at 100 characters and it can only contains letters and numbers. If the value of ViewHint is the string json, the action method will return the ViewModel in jSon format. It accepts an optional argument of type JsonRequestBehavior

ClentValidationViewResult. Define a ViewContext for all input items rendered in it. It allows a partial View that doesn' contain a form be able to generate client side validation code. It is usefull to inject Ajax generated html into a pre-existing form. 

ClientBlockResult. Used to define a Client Block based on the whole server side ViewModel. It is returned by the ClientBlockView controller extension method. See here for more information on Client Blocks.

Last edited Feb 12, 2012 at 6:01 PM by frankabbruzzese, version 7

Comments

No comments yet.