Example #1
0
        /// <summary>
        /// Redirects to the specified action by
        /// using <see cref="Expression{TDelegate}"/> for an action method,
        /// from which action name, controller name and route values are resolved,
        /// and the specified additional route values.
        /// </summary>
        /// <typeparam name="TRedirectController">Controller, from which the action is specified.</typeparam>
        /// <param name="action">
        /// The <see cref="Expression{TDelegate}"/>, from which action name,
        /// controller name and route values are resolved.
        /// </param>
        /// <param name="routeValues">Additional route data to use for generating the URL.</param>
        /// <returns>The created <see cref="RedirectToActionResult"/> for the response.</returns>
        public static RedirectToActionResult RedirectToAction <TRedirectController>(
            this Controller controller,
            Expression <Action <TRedirectController> > action,
            object routeValues)
        {
            var expressionRouteValues = ExpressionRouteHelper.Resolve(action, routeValues);

            return(controller.RedirectToAction(
                       expressionRouteValues.Action,
                       expressionRouteValues.Controller,
                       routeValues));
        }
Example #2
0
 public static IActionResult RADialogViewContentFrame(
     this Controller controller,
     string contentUrl,
     string containerClass = null,
     string containerStyle = "width: 100%; height: 500px;",
     string frameClass     = null,
     string frameStyle     = null,
     bool printFrameOnLoad = false,
     bool showPrintButton  = false)
 {
     return(controller.RedirectToAction("DialogViewContentFrame", "RA", new
     {
         contentUrl,
         containerClass,
         containerStyle,
         frameClass,
         frameStyle,
         printFrameOnLoad,
         showPrintButton,
     }));
 }
Example #3
0
 public static IActionResult RAPartialViewContentFrame(
     this Controller controller,
     string contentUrl,
     string containerClass      = "ra-fullsize",
     string containerStyle      = null,
     string frameClass          = null,
     string frameStyle          = null,
     bool showLoadingFullHeight = true,
     bool printFrameOnLoad      = false,
     bool showPrintButton       = false)
 {
     return(controller.RedirectToAction("PartialViewContentFrame", "RA", new
     {
         contentUrl,
         containerClass,
         containerStyle,
         frameClass,
         frameStyle,
         printFrameOnLoad,
         showPrintButton,
     }));
 }
Example #4
0
 /// <summary>
 /// Redirects to the specified action by
 /// using <see cref="Expression{TDelegate}"/> for an action method,
 /// from which action name, controller name and route values are resolved.
 /// </summary>
 /// <typeparam name="TRedirectController">Controller, from which the action is specified.</typeparam>
 /// <param name="action">
 /// The <see cref="Expression{TDelegate}"/>, from which action name,
 /// controller name and route values are resolved.
 /// </param>
 /// <returns>The created <see cref="RedirectToActionResult"/> for the response.</returns>
 public static RedirectToActionResult RedirectToAction <TRedirectController>(
     this Controller controller,
     Expression <Action <TRedirectController> > action)
 {
     return(controller.RedirectToAction(action, routeValues: null));
 }
Example #5
0
 public static IActionResult RedirectToEdit <T>(
     this Controller controller,
     T id) => controller.RedirectToAction("Edit", new {
     id
 });
Example #6
0
 public static IActionResult RedirectToDefault(
     this Controller controller) => controller.RedirectToAction("Default");