相关疑难解决方法(0)

Url.Action参数?

在列出控制器我有,

 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 asp.net url.action asp.net-mvc-2

111
推荐指数
2
解决办法
31万
查看次数

如何在@ Html.ActionLink中添加图像

我需要知道如何添加图像 @Html.ActionLink

我的代码是:

@Html.ActionLink("IMAGE","Index","Home"); 
Run Code Online (Sandbox Code Playgroud)

如何使用我的图像所在的URL替换IMAGE.

c# asp.net-mvc-4

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

asp.net ×1

asp.net-mvc-2 ×1

asp.net-mvc-4 ×1

c# ×1

html ×1

url.action ×1