开发者

2nd level view in ASP.net MVC

I have an address "http://localhost:3579/MusicStore/StoreManager" which is really showing "http://localhost:3579/MusicStore/StoreManager/Index".

I want to go to another another address on the same level from the index: "http://localhost:3579/MusicSt开发者_运维技巧ore/StoreManager/Edit". Edit is a view inside the StoreManager folder, so a 2nd level view.

I'm confused as to which controller I'd even put the method in. I tried putting my "public ActionResult Edit" in MusicStoreController, but it wasn't recognized. How can I do this?


It sounds like your action is in the right place, but you will need to make sure there is a route specified to route your URL to that action. Make sure a route like this is specified in your global.asax or area registration file if your project is using areas:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜