在get动作方法中,我返回视图并将模型传递给它。
return View("MyView", model);然后,我在url中获得了模型细节所需的视图。
host:/response?id=1&otherId=2 ...我想要下一个网址:
host:/response怎么弄到?或者如何按照我想要的方式绘制路线?
发布于 2015-06-18 07:25:38
在解决方案资源管理器中,转到App_Start文件夹。在该文件夹中打开RouteConfig.cs文件。打开它。你会展示出
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Shared", action = "WelcomeView", id = UrlParameter.Optional }根据您想要显示的内容更改url:。如果您不想在您的url中看到id,我建议您做一个新的MapRoute,不要在其中包括id
https://stackoverflow.com/questions/30870939
复制相似问题