4
网址操作参数?
在列表控制器中, public ActionResult GetByList(string name, string contact) { var NameCollection = Service.GetByName(name); var ContactCollection = Service.GetByContact(contact); return View(new ListViewModel(NameCollection ,ContactCollection)); } 在ASPX页面中,我称之为 <a href="<%:Url.Action("GetByList","Listing" , new {name= "John"} , new {contact="calgary, vancouver"})%>"><span>People</span></a> 我在ASPX代码中有问题...我可以拉出名字john的记录。但是当我给时contact="calgary, vancouver",网页就会出错。 如何在中调用两个参数Url.Action。我尝试了以下内容,但这似乎也是错误的。 <a href="<%:Url.Action("GetByList","Listing" , new {name= "John" , contact= " calgary, vancouver" })%>"><span>People</span></a>