1

I have the following button on my website

@Html.ActionLink("Stock Manager", "Index", "StockManager",
 new { area = "Home" }, new { @class = "logo-stock-manager", @style = "float:left;" })

With the following method in the StockManagerController

public ActionResult Index()
{
     return View();
}

Some people that use my website have reported that when they're on localhost/Home/Quiosk/Index and click the button I mentioned they get redirected to localhost without any additional path instead of localhost/Home/StockManager/Index, they said that cleaning the browser data fixed it but sometimes it starts happening again.

I haven't had this problem in development or testing so I've never been able to debug it.

I release updates for my website every other week but I haven't changed these buttons in a while so I don't understand how cached data could be the problem. Is there a better approach to what I'm currrently doing? Using something different than ActionLink maybe ?

Kermode
  • 139
  • 11
  • It is possible that they are losing session and it works again after cleaning cache because the user is prompted to login again. However this is just speculation. I believe this kind of questions are not suitable for SO. According to the guidelines you need to reproduce the problem before asking for help to fix it. – derloopkat Apr 06 '23 at 04:44

1 Answers1

0

When you use the 'Html.ActionLink' in .NET MVC to create a link to another view within the same application, it will generate a URL based on the routing configuration of yout application. If the URl generated by the link redirects to 'localhost' only, it is likely due to:

  1. Incorrect Routing
  2. Incorrect method parameters on 'Html.ActionLink'
  3. Bad SSL Configuration (if is the case)
  4. Incorrectly specified path on route configuration

Check these 4 points, probably is one of them

Nightmare
  • 1
  • 2