Class ZptSharpViewEngine
The ZptSharp MVC ViewEngine, used to render MVC views using ZptSharp.
Inheritance
Implements
Inherited Members
Namespace: ZptSharp.Mvc5
Assembly: ZptSharp.Mvc5.dll
Syntax
public class ZptSharpViewEngine : IViewEngine
Remarks
Please note that a number of ASP.NET MVC-related features are unsupported by ZptSharp views, as they are not relevant in the context of ZptSharp views. These features includes:
Usages of parameters relating to these unsupported features will be ignored (and a normal view will be returned regardless). Usages of methods relating to these unsupported features will return a normal view.
Constructors
| Improve this Doc View SourceZptSharpViewEngine(Action<IBuildsHostingEnvironment>, String[], String, RenderingConfig, IFindsView)
Initializes a new instance of the ZptSharpViewEngine class.
Declaration
public ZptSharpViewEngine(Action<IBuildsHostingEnvironment> builderAction, string[] viewLocationFormats = null, string viewsPath = "~/Views/", RenderingConfig config = null, IFindsView viewFinder = null)
Parameters
Type | Name | Description |
---|---|---|
System.Action<IBuildsHostingEnvironment> | builderAction | A builder action for creating the ZptSharp hosting environment. |
System.String[] | viewLocationFormats | View location formats. |
System.String | viewsPath | The virtual path for the |
RenderingConfig | config | An optional rendering config instance. |
IFindsView | viewFinder | An optional view-finder instance. This parameter is provided primarily for unit-testing purposes; if omitted or passed as null then a default instance will be used. |
Methods
| Improve this Doc View SourceFindPartialView(ControllerContext, String, Boolean)
Gets a System.Web.Mvc.ViewEngineResult from an attempt to find a ZptSharp view of the specified
partialViewName
.
Declaration
public ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName, bool useCache)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Mvc.ControllerContext | controllerContext | The current controller context. |
System.String | partialViewName | The name of the requested view. |
System.Boolean | useCache | Indicates whether or not a view-location cache should be used or not. |
Returns
Type | Description |
---|---|
System.Web.Mvc.ViewEngineResult | A System.Web.Mvc.ViewEngineResult indicating whether the view was found or not. |
FindView(ControllerContext, String, String, Boolean)
Gets a System.Web.Mvc.ViewEngineResult from an attempt to find a ZptSharp view of the specified
viewName
.
Declaration
public ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Mvc.ControllerContext | controllerContext | The current controller context. |
System.String | viewName | The name of the requested view. |
System.String | masterName | An ignored parameter indicating the name of the master page.. |
System.Boolean | useCache | Indicates whether or not a view-location cache should be used or not. |
Returns
Type | Description |
---|---|
System.Web.Mvc.ViewEngineResult | A System.Web.Mvc.ViewEngineResult indicating whether the view was found or not. |
Explicit Interface Implementations
| Improve this Doc View SourceIViewEngine.ReleaseView(ControllerContext, IView)
Declaration
void IViewEngine.ReleaseView(ControllerContext controllerContext, IView view)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Mvc.ControllerContext | controllerContext | |
System.Web.Mvc.IView | view |