Class ViewRenderer

Class that renders MVC views to a string using the standard MVC View Engine to render the view.

Requires that ASP.NET HttpContext is present to work, but works outside of the context of MVC

System.Object
  Westwind.Web.Mvc.ViewRenderer
public class ViewRenderer : object

Class Members

MemberDescription

Constructor

Initializes the ViewRenderer with a Context.

CreateController<T>

Creates an instance of an MVC controller from scratch when no existing ControllerContext is present

public static T CreateController(RouteData routeData)

RenderPartialView

Renders a partial MVC view to given Writer. Use this method to render a partial view that doesn't merge with _Layout and doesn't fire _ViewStart.

public void RenderPartialView(string viewPath,     object model,     TextWriter writer)

public static string RenderPartialView(string viewPath,     object model,     ControllerContext controllerContext)

public static void RenderPartialView(string viewPath,     TextWriter writer,     object model,     ControllerContext controllerContext)

RenderPartialViewToString

Renders a partial MVC view to string. Use this method to render a partial view that doesn't merge with _Layout and doesn't fire _ViewStart.

public string RenderPartialViewToString(string viewPath,     object model)

RenderView

Renders a full MVC view to a writer. Will render with the full MVC View engine including running _ViewStart and merging into _Layout

public void RenderView(string viewPath,     object model,     TextWriter writer)

public static string RenderView(string viewPath,     object model,     ControllerContext controllerContext)

public static void RenderView(string viewPath,     TextWriter writer,     object model,     ControllerContext controllerContext)

public static string RenderView(string viewPath,     object model,     ControllerContext controllerContext,     ref string errorMessage)

public static void RenderView(string viewPath,     object model,     TextWriter writer,     ControllerContext controllerContext,     ref string errorMessage)

RenderViewToString

Renders a full MVC view to a string. Will render with the full MVC View engine including running _ViewStart and merging into _Layout

public string RenderViewToString(string viewPath,     object model)

Requirements

Namespace: Westwind.Web.Mvc
Assembly: westwind.web.mvc.dll

© West Wind Technologies, 1996-2016 • Updated: 12/12/15
Comment or report problem with topic