Asp.net MVC Tips(routing)
时间:2011-03-10 来源:Stone Xie
纯属个人记录,即时添加。 1. Register routesroutes. MapRoute( "default", "{controller}/{action}/{id}/{name}", new { controller = "Home", action = "Index", id = "", name = "" } ); 2. Controller: public ActionResult Indexa(int id, string name) { ViewData[ "Message"] = "Welcome to ASP.NET MVC! " + id + " " + name; return View("Index"); } @Html.ActionLink( "To home", "indexa","home", new{id="5687",name="hahaha"},"");
相关阅读 更多 +