Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
507 views
in Technique[技术] by (71.8m points)

query string - ASP.NET MVC - Adding querystring "length=" to ActionLinks?

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 removed?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...