Richard Watts Richard Watts - 6 months ago 45
AngularJS Question

MVC View not refreshed after menu click (angularjs is being used)

I have an MVC site with some of the pages using angular using the angular silo pattern.

If I navigate to a non angular page routing works fine taking me to the controller and then then view. However once on that page if I click on the same menu item again I am not routed to the controller method as before, nothing happens.

I don't know if this is default behaviour and I haven't noticed, a caching issue, or if using angular has changed something.

Has anyone had this issue, and how do you get the second click of the menu to route to the controller

public ActionResult Dashboard()
return View();

<a href="/Monitoring/Dashboard" id="MonitoringSubmenu" target="">Monitoring</a>


Jahongir Rahmonov's answer was not correct as the page is NOT an angular page, however calling a javascript function which calls the controller did fix the problem, so many thanks Below is the code

<a onclick="changeRouteToDashboard()" href="" id="MonitoringSubmenu" target="">Monitoring</a>

function changeRouteToDashboard(){
    window.location.href = "/Monitoring/Dashboard"