2014-05-16 36 views
0

由於某種原因,下面的代碼將null傳遞給控制器​​。我之前使用過類似的代碼,所以我不知道爲什麼這不起作用。kendo grid中的actionlink不會將值傳遞給控制器​​

我可以從模型直接傳遞參數一樣,我在這裏做什麼? HtML.Raw是否搞亂了它?

@(Html.Kendo().Grid(Model.GiIncidentReportList) 
        .Name("IRGrid") 
        .Columns(columns => 
        { 

         columns.Bound(r => r.IncidentReport.IR_IncidentID) 
          .Template(@<text>@Html.Raw(@Html.ActionLink("[replacetext]", "Index", "WorkflowOverview", 
       new { area = "Dailylog" }, new { id = item.IncidentReport.IR_IncidentID }).ToHtmlString().Replace("[replacetext]", "<img src=\"/Images/icon_edit.gif\" />")) </text>) 
      .Title("").Width(70); 






         columns.Bound(r => r.IncidentReport.IR_CaseNumber).Title("Case Number"); 
         columns.Bound(r => r.IncidentCreatedByName).Title("Created By"); 
         columns.Bound(r => r.IncidentReport.IR_CreatedDate).Title("Created Date"); 
         columns.Bound(r => r.IncidentUpdatedByName).Title("Updated By"); 
         columns.Bound(r => r.IncidentReport.IR_UpdatedDate).Title("Updated Date"); 
        } 

       ) 

      ) 

回答

0

這是我如何得到它的工作。

columns.Bound(r => r.IncidentReport.IR_IncidentID) 
          .Template(@<text>@Html.Raw(@Html.ActionLink("[replacetext]", "Index", "WorkflowOverview", 
       new { area = "Dailylog", id = item.IncidentReport.IR_IncidentID }, null).ToHtmlString().Replace("[replacetext]", "<img src=\"/Images/icon_edit.gif\" />")) </text>) 
      .Title("").Width(70);