在列出控制器我有,
public ActionResult GetByList(string name, string contact)
{
var NameCollection = Service.GetByName(name);
var ContactCollection = Service.GetByContact(contact);
return View(new ListViewModel(NameCollection ,ContactCollection));
}
Run Code Online (Sandbox Code Playgroud)
在ASPX页面我打电话,
<a href="<%:Url.Action("GetByList","Listing" , new {name= "John"} , new {contact="calgary, vancouver"})%>"><span>People</span></a>
Run Code Online (Sandbox Code Playgroud)
我在ASPX代码中遇到问题...我可以提取名称为john的记录.但当我给联系人="卡尔加里,温哥华"时,网页会出错.
如何在Url.Action中调用两个参数.我尝试了以下但这似乎也错了.
<a href="<%:Url.Action("GetByList","Listing" , new {name= "John" , contact= " calgary, vancouver" })%>"><span>People</span></a>
Run Code Online (Sandbox Code Playgroud) 我需要知道如何添加图像 @Html.ActionLink
我的代码是:
@Html.ActionLink("IMAGE","Index","Home");
Run Code Online (Sandbox Code Playgroud)
如何使用我的图像所在的URL替换IMAGE.