View Level 2 in ASP.net MVC

I have the address "http: // localhost: 3579 / MusicStore / StoreManager" that really shows "http: // localhost: 3579 / MusicStore / StoreManager / Index".

I want to go to another address at the same level from the index: "http: // localhost: 3579 / MusicStore / StoreManager / Edit". Edit is a view inside the StoreManager folder, therefore a view of the 2nd level.

I was confused about which controller I even turned on. I tried to put my “public ActionResult Edit” in the MusicStoreController, but it was not recognized. How can i do this?

+4
source share
1 answer

It looks like your action is in the right place, but you will need to make sure the route specified for routing your URL is specified for this URL. Make sure that such a route is specified in your global.asax or region registration file if your project uses regions:

context.MapRoute( "MusicStore_Edit", "MusicStore/StoreManager/{action}", new { action = "Index"} ); 
+2
source

All Articles