Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RedirectToAction on another controller clears action parameters #34

Open
viktorsykora opened this issue Jul 4, 2019 · 3 comments
Open
Assignees
Milestone

Comments

@viktorsykora
Copy link

Hi,

Just found a possible issue when calling RedirectToAction with target action on another controller.

Here is the code:

public class HomeController : Controller
{
    public IActionResult Index()
    {
        return this.RedirectToAction<TestController>(c => c.Test(9));
    }
}
public class TestController : Controller
{
    public IActionResult Test(long id)
    {
        return View();
    }
}

The id parameter in Test action should be 9, but it's defaulted to 0. When I move the Test action into HomeController then it starts to work just fine.

Any suggestions appreciated,
Thanks

@ivaylokenov
Copy link
Owner

Hi @viktorsykora! Which version of ASP.NET Core are you using?

@viktorsykora
Copy link
Author

It's ASP.NET Core 2.1.1.

@ivaylokenov
Copy link
Owner

Hi, thank you for your issue. Since I am overwhelmed with my other project https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc, I did not have a lot of time to support this one. Will try to publish a new package during the weekend. Thank you for your patience!

@ivaylokenov ivaylokenov self-assigned this Sep 10, 2019
@ivaylokenov ivaylokenov added this to the Version 2.0.0 milestone Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants