我在view页面里用这种方式生成的url
<% =Url.Action("ArticleInfo", new { id = article.ID }) %>"><% =article.Title %></a>
怎么生成后不是Url-id.aspx,而是Url.aspx?id=...
谢谢!
Global中的url配置中下:
Code
routes.MapRoute("Url", "",
new { controller = "Home", action = "Index" });
routes.MapRoute("Url1", "{controller}.aspx",
new { controller = "Home", action = "Index" },
new { controller = "[a-zA-Z]+", action = "[a-zA-Z]+" });
routes.MapRoute("Url2", "{controller}/{action}.aspx",
new { controller = "Home", action = "Index"},
new { controller = "[a-zA-Z]+", action = "[a-zA-Z]+"});
routes.MapRoute("Url3", "{controller}/{action}-{id}.aspx",
new { controller = "Home", action = "Index", id = ""},
new { controller = "[a-zA-Z]+", action = "[a-zA-Z]+", id = "\\d+|(\\d,)+"});
routes.MapRoute("Url4", "{controller}/{action}_{page}.aspx",
new { controller = "Home", action = "Index", page = "1" },
new { controller = "[a-zA-Z]+", action = "[a-zA-Z]+", page = "\\d+" });
routes.MapRoute("Url5", "{controller}/{action}-{id}_{page}.aspx",
new { controller = "Home", action = "Index", id = "", page = "1" },
new { controller = "[a-zA-Z]+", action = "[a-zA-Z]+", id = "\\d+|(\\d,)+", page = "\\d+" });