Click here to Skip to main content
15,886,769 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
In my View.cshtml I have:
@if (@ViewBag.Disabled == false || @ViewBag.Disabled == null)
                   {
       <td>
          <button id="btn" class="button btn-primary" type="button" onclick="location.href='@Url.Action("RunAllTests", new { id = @id })'"> Run Test</button>
        <img id="loading" src="img/ajax-loader.gif" alt="" style="display:none;" />
     </td>

      }


In my HomeController.cs
C#
public IActionResult Index()
    {
        var items = _service.GetAllTests<Data>();
        return View(items);
    }

And:
C#
public IActionResult RunAllTests(int id) {
        _service.RunAllTests(id);
        var items = _service.GetAllTests<Data>();
        return RedirectToAction("Index");
    }


What I have tried:

On Windows everything works just fine it redirects to home page ("Index" => localhost:5000) as it should, however when I deploy to linux server it creates wrong url and redirects to: http://server:5000/Home/RunAllTests/374 instead of http://server:5000

I don't understand why it work on windows but doesn't work on linux? How to fix that?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900