lundi 20 avril 2015

How to get submited form in action?

I have this HTML5 code:

   <form id="LogInArea"  action = "/Home/ValidateUser" >
    <fieldset>
        <legend>Login Page</legend>
        <p>
        <label>
            User name<br>
            <input type="text" id="userName" required></label></p>
        <p><label>
            Password<br>
            <input type="password" id="password" required></label></p>
        <p>@*<button id="LoginButton">
            Log in</button>*@
            <button>submit</button>
            </p>
        <a href="/Home/RegisterPage">Register</a> if you don't have an account.
    </fieldset>
</form>

When I press the submit button the ValidateUser() action in Home controller is fired.

My question is how can I get the submitted form in ValidateUser() action and how I get the values of form element?

P.S. I don't want to use model!

Aucun commentaire:

Enregistrer un commentaire