HtmlHelper及
ViewPage的扩展
增加了RenderAction及RenderRoute的扩展
定义
C#:
public static class ViewExtensions
{
public static void RenderAction<TController>(this HtmlHelper helper, Expression<Action<TController>> action) where TController: Controller;
public static void RenderAction(this HtmlHelper helper, string actionName);
public static void RenderAction(this HtmlHelper helper, string actionName, string controllerName);
public static void RenderAction(this HtmlHelper helper, string actionName, string controllerName, object values);
public static void RenderAction(this HtmlHelper helper, string actionName, string controllerName, RouteValueDictionary values);
public static void RenderRoute(this HtmlHelper helper, RouteValueDictionary values);
}
使用方法:
C#:
<%=Html.RenderUserControl("~/views/user/index-account.ascx", ViewData.Model)%>