Reputation: 13367
How can i pass to asp.net mvc action parameters like: line[first], line[second], line[third], people[john] etc?
For example we have html:
<form>
<input type="hidden" name="line[first]" value="hello" />`
<input type"submit" value="send" />
</form>
How we can take "line[first]" value when user clicks on send button?
Upvotes: 0
Views: 97
Reputation: 3932
[HttpPost, ValidateAntiForgeryToken]
public ActionResult ShowLogin(LoginModel model)
{
model.username;
model.password
}
instead of admin you can have
public ActionResult ShowLogin(FormCollection form)
{
var user = form["username"];
}
Upvotes: 2