asp.net-mvcasp.net-mvc-partialview

Page refresh in MVC is calling many methods in more than one controller


I have a index page for which the the layout page is different and there is another index page in a different folder under the same project. Both these index pages have one and two partial views in each and also have their own controllers, one is home and the other testController.

My problem is when I hit f5 in the browser, it is calling the partial view method and index method for both the controllers home and the testcontroller and it is clearing off certain variables. My understanding is that it must call only the index method of the testcontroller and call the partial views which is in this page and controller. Is my understanding wrong?


Solution

  • I figured out the problem I had with both controller index methods being called. I was using the same layout page in both index pages. Point one of the index pages to the right layout page stopped calling the Home controllers index method.