MVC my url is creating “?Length=4”

后端 未结 2 1114
温柔的废话
温柔的废话 2021-02-15 13:53

I am creating an MVC4 application. I have a small issue. My code is

  • @Html.ActionLink(\"Contract\", \"Contract\", \"Home\", new {
  • 2条回答
    •  广开言路
      2021-02-15 14:09

      You mixed up the parameters. You have to send anonymous object as htmlAttributes parameter.

      @Html.ActionLink("Contract", "Contract", "Home", null ,new { id = "lnk_contract" })
      

      Here's the MSDN page for this overload:

      http://msdn.microsoft.com/en-us/library/dd504972(v=vs.108).aspx

    提交回复
    热议问题