ASP.NET MVC - 添加查询字符串"长度="到ActionLinks? [英] ASP.NET MVC - Adding querystring "length=" to ActionLinks?

查看:99
本文介绍了ASP.NET MVC - 添加查询字符串"长度="到ActionLinks?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个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?

推荐答案

在猜测,你可能正在使用Html.ActionLink错误的过载和添加到路由参数,而不是HTML属性。您需要添加一个NULL作为前你指定的HTML属性的第四个参数。是这样的:

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"} )

发表您的code,如果这是行不通的。

Post your code if this doesn't work.

这篇关于ASP.NET MVC - 添加查询字符串"长度="到ActionLinks?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆