我正在尝试创建一个ActionLink来从网格中导出数据.网格由查询字符串中的值过滤.这是url的一个例子:
http://www.mysite.com/GridPage?Column=Name&Direction=Ascending&searchName=text
Run Code Online (Sandbox Code Playgroud)
这是将ActionLink添加到页面的代码:
@Html.ActionLink("Export to Excel", // link text
"Export", // action name
"GridPage", // controller name
Request.QueryString.ToRouteDic(), // route values
new { @class = "export"}) // html attributes
Run Code Online (Sandbox Code Playgroud)
显示链接时,网址为:
http://www.mysite.com/GridPage/Export?Count=3&Keys=System.Collections.Generic.Dictionary%602%2BKeyCollection%5BSystem.String%2CSystem.Object%5D&Values=System.Collections.Generic.Dictionary%602%2BValueCollection%5BSystem.String%2CSystem.Object%5D
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?