我打电话使用Url.action
像一个控制器的方法,只有使用Url.action调用控制器方法时,第一个参数值正在获取。
location.href = '@Url.Action("Display", "Customer", new { username = "abc",name = "abcdef",country = "India",email = "[email protected]",phone = "9456974545"})';
我控制器的方法是,
public void Display(string username, string name, string country, string email, string phone)
{ }
在这种方法中,我可以得到一个参数(username
)才值。它没有获得传递的其他参数值。所有其他值都为空。
请建议我,最新怎么了?
你能看到在浏览器中的查询字符串参数地址栏用户点击ActionLink什么时候? – 2013-02-14 06:13:24
是的。我可以在浏览器地址栏中看到查询字符串参数。 url是这样的:http:// localhost:60710/Customer/Display?username = abc & name = abcdef & country = India & email = abc%40hmail.com & phone = 9456974545 – Kokila 2013-02-14 06:17:40
这是什么?在这里贴吧 – 2013-02-14 06:18:33