小编Jef*_*eff的帖子

ASP.NET MVC - 在Html.ActionLink routeValues中传递模型的麻烦

我的视图如下所示:

<%@ Control Language="C#" 
    Inherits="System.Web.Mvc.ViewUserControl<TMS.MVC.BusinessSystemsSupport.Models.SearchDataTypeModel>" %>


<table class="classQueryResultsTable">
   <!-- the header -->
  <tr class="headerRow">

      <td>
      <%= Html.ActionLink("Effective Startdate",
                  "SortDetails",
                  "DataQryUpdate",
                  new
                  {
                      model = Model,
                      sortBy = "EffectiveStartDate",
                  },
                  new { @class = "classLinkLogDetails" })%>
      </td>

  </tr>


</table>
Run Code Online (Sandbox Code Playgroud)

我的控制器动作:

    public ActionResult SortDetails(SearchDataTypeModel model, String sortBy)
    {
Run Code Online (Sandbox Code Playgroud)

model参数为null.sortBy参数已填充.我可以将模型中的String属性传递给操作,没有任何问题.我想传递整个模型.

我有什么想法我做错了吗?

c# asp.net asp.net-mvc

12
推荐指数
3
解决办法
3万
查看次数

标签 统计

asp.net ×1

asp.net-mvc ×1

c# ×1