tags:

views:

38

answers:

1

Hi!

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?

+2  A: 
[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"];
   }
minus4