Skip to content

Redirect to action in another controller? #14

@djordjedjukic

Description

@djordjedjukic

Hi Jimmy,

In ControllerExtensions you have method RedirectToActionJson, and you create url for redirect on this way: redirect = controller.Url.Action(action). You are using it like this:
return this.RedirectToActionJson(nameof(Index));

This will not work if you want to redirect on action from another controller.
Mu solution is to change:
redirect = controller.Url.Action(action) to redirect = action
and then to call it:
return this.RedirectToActionJson(Url.Action("Action", "Controller"));

Do you maybe have some better suggestion?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions