In listing controller I have,
public ActionResult GetByList(string name, string contact)
{
var NameCollection = Service.GetByName(name);
var ContactCollection = Service.GetByContact(contact);
return View(new ListViewModel(NameCollection ,ContactCollection));
}
In ASPX page I call,
<a href="<%:Url.Action("GetByList","Listing" , new {name= "John"} , new {contact="calgary, vancouver"})%>"><span>People</span></a>
I have a problem in the ASPX code... I can pull the records for the name john. but when I give the contact="calgary, vancouver"
, the webpage goes to error.
How can I call two parameters in the Url.Action
. I tried the below but that seems wrong too.
<a href="<%:Url.Action("GetByList","Listing" , new {name= "John" , contact= " calgary, vancouver" })%>"><span>People</span></a>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…