ASP.NET MVC - Adding querystring “length=” to ActionLinks?

前端 未结 4 755
南方客
南方客 2020-12-17 08:14

I have a few ActionLinks that when rendered are getting a length key/value added that appears to indicate the number of characters of the controller name. How can this be r

4条回答
  •  心在旅途
    2020-12-17 08:49

    At a guess, you are probably using the wrong overload of Html.ActionLink and are adding to the route parameters instead of the HTML attributes. You need to add a NULL as the fourth parameter before your specify the HTML attributes. Something like:

     Html.ActionLink("Title", "Action", "Controller", null ,new { title = "Title"} )
    

    Post your code if this doesn't work.

提交回复
热议问题