RickStrahl / Westwind.AspnetCore.LiveReload

ASP.NET Core Live Reload Middleware that monitors file changes in your project and automatically reloads the browser's active page
Other
469 stars 42 forks source link

Can't redirect view after enable LiveReload in asp.net core 3.0 #15

Closed EurekaChen closed 4 years ago

EurekaChen commented 4 years ago

After enble LiveReload, using MVC Controller, when submit form and return RedirectToAction(nameof(Index)) can not take effect. When remove LiveReload, It work.

hey-red commented 4 years ago

Yes, same issue.

RickStrahl commented 4 years ago

I can't duplicate this.

In the .NET Core 3.0 sample project I have:

 public IActionResult Privacy()
        {
            return View();
        }

        [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
        public IActionResult Error()
        {
            return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
        }

        public IActionResult Redirect()
        {
            return RedirectToAction(nameof(Privacy));
        }

The redirect works in this scenario. Can you check the sample and see if you can find a repo case?

Make sure you use the latest package too - there were some fixes in recent versions that might have affected this behavior.

hadisonick commented 4 years ago

Hi @RickStrahl , just came across a similar issue which it stops redirecting to action when form Posting back. What happens is the form posts to trigger updating css files and the page gets refreshed however it seems to lose track to 'return RedirctToAction(action)' Is it sth can be considered to have options for excluding POST method per request?