Note: This class can only be used within MVC applications that have an active ControllerContext.
public class ViewRenderer : object
Member | Description | |
---|---|---|
Constructor | ||
RenderPartialView | 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 RenderPartialView(string viewPath,
object model); public static string RenderPartialView(string viewPath,
object model, ControllerContext controllerContext); public static string RenderPartialView(string viewPath,
object model, ControllerContext controllerContext, ref string errorMessage); |
|
RenderView | 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 RenderView(string viewPath,
object model); public static string RenderView(string viewPath,
object model, ControllerContext controllerContext); public static string RenderView(string viewPath,
object model, ControllerContext controllerContext, ref string errorMessage); |