我如何传递给asp.net mvc动作参数,如:line [first],line [second],line [third],people [john] etc?
例如我们有html:
<form>
<input type="hidden" name="line[first]" value="hello" />`
<input type"submit" value="send" />
</form>
当用户点击发送按钮时,我们如何获取“line [first]”值?
答案 0 :(得分:2)
[HttpPost, ValidateAntiForgeryToken]
public ActionResult ShowLogin(LoginModel model)
{
model.username;
model.password
}
而不是管理员,你可以拥有
public ActionResult ShowLogin(FormCollection form)
{
var user = form["username"];
}