【发布时间】:2013-01-29 21:13:43
【问题描述】:
我正在使用Url.action 之类的方式调用控制器方法,
location.href = '@Url.Action("Display", "Customer", new { username = "abc",name = "abcdef",country = "India",email = "abc@hmail.com",phone = "9456974545"})';
我的控制器方法是,
public void Display(string username, string name, string country, string email, string phone)
{ }
在这个方法中,我只能得到第一个参数的值(username)。它没有得到传递的其他参数值。所有其他值为空。
请给我建议,有什么问题?
【问题讨论】:
-
点击ActionLink时浏览器地址栏能看到查询字符串参数吗?
-
是的。我可以在浏览器地址栏中看到查询字符串参数。网址是这样的:localhost:60710/Customer/…
-
这是什么?粘贴到这里
-
嗯.. 像这样试试
@Html.Raw(@Url.Action("Display","Customer", new { username = "abc",name = "abcdef"}))
标签: asp.net-mvc controller url.action