I am using ASP.NET 5. Using the Chrome browser.
My controller has the following action method
public async Task<IActionResult> Index() { return View(); } [HttpPost] public IActionResult DoSomething() {
When i started
http: // localhost: 59693 / MyArea / MyController / DoSomething
through POST in the index
and have a breakpoint on the line
return RedirectToAction("Index");
it simply ignores the line and moves on to the next line without calling the index action method.
and displayed in the browser
http: // localhost: 59693 / MyArea / MyController / DoSomething
with a blank screen.
Of course, if you have a return statement, it immediately returns from this method and does not go to the next line. Really odd.
I even tried completely
return RedirectToAction("Index","MyController,new {area="MyArea"});
When I put a breakpoint in my index action method, it never hits.
I even tried
return Redirect("http://www.google.com");
It still displays
http: // localhost: 59693 / MyArea / MyController / DoSomething
Some error in ASP.NET 5?
How can I call an action method from an action method in the same controller if the above does not work?