如何使用Ajax.ActionLink从视图传递Array? [英] How pass Array to action with Ajax.ActionLink from view?
本文介绍了如何使用Ajax.ActionLink从视图传递Array?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用razor并将数组传递给控制器。数组包含字符串类型。
视图中的示例数组:
I am using razor and passing an array to a controller. the array contains string type.
example array in view :
@{
.
.
.
string[] menustatus = ViewBag.MENUS;
}
.
.
.
@Ajax.ActionLink("linkname",ActionName, ControllerName, new { status = menustatus }, new AjaxOptions { HttpMethod = "Post" }, null)
my控制器是:
my controller is :
public ActionResult ActoinName(params string[] status)
{
}
status变量包含值ofsystem.string []
我希望数组值传递给动作。
status Variable contains value of "system.string[]"
I expect the array values are passed to the action.
推荐答案
这篇关于如何使用Ajax.ActionLink从视图传递Array?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文