I am trying to create an e-commerce application and now I am at the part where I have to create the account management logic.I am trying to take advantage of the Membership API but I can’t seem to find a way on how to proceed.
My application has two databases is the one containing all the tables for the e-commerce application and the second is the one generated by asp.net for using it with the Membership API.
I do not know how I can retrieve the data the user inputs.
This is what I am planning to do:
[HttpPost]
public ActionResult LogIn()
{
if(ModelState.IsValid)
{
if(Membership.ValidateUser(username , password))
{
}
}
}
Can anyone please give me an idea on how I can retrieve the user’s input?
You’re going to need to pass a model in. Let’s say for example I’ve got a view with a form on it and it has the following fields:
Now I’m going to need a model to serialize this into:
Now I’m going to want to receive that model into the action method:
When the
POSToccurs, ASP.NET MVC will build the model for you out of the input fields inside the form.