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));
        }
예제 #2
0
        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);
        }
예제 #3
0
        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));
        }
예제 #4
0
        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));
        }
예제 #5
0
        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));
        }
예제 #7
0
        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)));
        }
예제 #8
0
        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)));
        }
예제 #9
0
        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)));
        }
예제 #10
0
        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)));
        }
예제 #11
0
        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)));
        }