public static string Action <TController>( this UrlHelper url, Expression <Func <TController, Task> > action, object routeValues = null) where TController : Controller { var routeInfo = RouteInformation.FromExpression <TController>(action, routeValues); return(url.Action(routeInfo.ActionName, routeInfo.ControllerName, routeInfo.RouteValueDictionary)); }
public static void RenderAction <TController>( this HtmlHelper helper, Expression <Func <TController, Task> > action, object routeValues = null) where TController : Controller { var routeInfo = RouteInformation.FromExpression <TController>(action, routeValues); helper.RenderAction(routeInfo.ActionName, routeInfo.ControllerName, routeInfo.RouteValueDictionary); }
public static MvcHtmlString Action <TController>( this HtmlHelper helper, Expression <Action <TController> > action, object routeValues = null) where TController : Controller { var routeInfo = RouteInformation.FromExpression <TController>(action, routeValues); return(helper.Action(routeInfo.ActionName, routeInfo.ControllerName, routeInfo.RouteValueDictionary)); }
public static MvcHtmlString Action <TController>( this HtmlHelper helper, Expression <Func <TController, Task> > action, object routeValues = null) where TController : Controller { var routeInfo = RouteInformation.FromExpression <TController>(action, routeValues); if (!DetermineUsingAreas(helper.RouteCollection)) { routeInfo.RouteValueDictionary.Remove("area"); } return(helper.Action(routeInfo.ActionName, routeInfo.ControllerName, routeInfo.RouteValueDictionary)); }
public static void RenderAction <TController>( this HtmlHelper helper, Expression <Action <TController> > action, object routeValues = null) where TController : Controller { var routeInfo = RouteInformation.FromExpression <TController>(action, routeValues); if (!DetermineUsingAreas(helper.RouteCollection)) { routeInfo.RouteValueDictionary.Remove("area"); } helper.RenderAction(routeInfo.ActionName, routeInfo.ControllerName, routeInfo.RouteValueDictionary); }
public static string Action <TController>( this UrlHelper url, Expression <Action <TController> > action, object routeValues = null) where TController : Controller { var routeInfo = RouteInformation.FromExpression <TController>(action, routeValues); if (!DetermineUsingAreas(url.RouteCollection)) { routeInfo.RouteValueDictionary.Remove("area"); } return(url.Action(routeInfo.ActionName, routeInfo.ControllerName, routeInfo.RouteValueDictionary)); }
public static MvcForm BeginForm <TController>( this AjaxHelper helper, Expression <Func <TController, Task> > action, object routeValues = null, AjaxOptions ajaxOptions = null, object htmlAttributes = null) where TController : Controller { var routeInfo = RouteInformation.FromExpression <TController>(action, routeValues); return(helper.BeginForm( routeInfo.ActionName, routeInfo.ControllerName, routeInfo.RouteValueDictionary, ajaxOptions, HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes))); }
public static MvcHtmlString ActionLink <TController>( this HtmlHelper helper, string linkText, Expression <Func <TController, Task> > action, object routeValues = null, object htmlAttributes = null) where TController : Controller { var routeInfo = RouteInformation.FromExpression <TController>(action, routeValues); return(helper.ActionLink( linkText, routeInfo.ActionName, routeInfo.ControllerName, routeInfo.RouteValueDictionary, HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes))); }
public static MvcForm BeginForm <TController>( this HtmlHelper helper, Expression <Action <TController> > action, FormMethod method, object routeValues = null, object htmlAttributes = null) where TController : Controller { var routeInfo = RouteInformation.FromExpression <TController>(action, routeValues); return(helper.BeginForm( routeInfo.ActionName, routeInfo.ControllerName, routeInfo.RouteValueDictionary, method, HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes))); }
public static MvcHtmlString ActionLink <TController>( this HtmlHelper helper, string linkText, Expression <Action <TController> > action, object routeValues = null, object htmlAttributes = null) where TController : Controller { var routeInfo = RouteInformation.FromExpression <TController>(action, routeValues); if (!DetermineUsingAreas(helper.RouteCollection)) { routeInfo.RouteValueDictionary.Remove("area"); } return(helper.ActionLink( linkText, routeInfo.ActionName, routeInfo.ControllerName, routeInfo.RouteValueDictionary, HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes))); }
public static MvcForm BeginForm <TController>( this HtmlHelper helper, Expression <Func <TController, Task> > action, FormMethod method, object routeValues = null, object htmlAttributes = null) where TController : Controller { var routeInfo = RouteInformation.FromExpression <TController>(action, routeValues); if (!DetermineUsingAreas(helper.RouteCollection)) { routeInfo.RouteValueDictionary.Remove("area"); } return(helper.BeginForm( routeInfo.ActionName, routeInfo.ControllerName, routeInfo.RouteValueDictionary, method, HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes))); }