I am having difficulty getting my MVC app to pass data from the view back to its controller.
I am using a shared view-model which has a few fields that are recognized by the controller. I can assign values to the speific members of the view-model class, and pass the data from the controller to the view, and the view recognizes the data and is able to make decisions on it, however, I do not know why when the user hits a button:
<input type = "submit" value = "Submit" />
on the view, which is located within a form:
<form action ="" method="post"> </form>
the controller, does not recognize the data.
I have the following clause specifying the model to use in my view:
@model LSWA.Models.SignInSignOutModel
@{
}
and the following controller method header:
[HttpPost]
public ActionResult SignOut(LearningServicesWebApp.Models.TutorSignInSignOutModel model)
I am not manipulating any data within my view, but I would like the controller to recognize the data that is being passed from the view when the user hits the submit button on my view. Again, when the user hits the post button the "model" variable of type "LearningServicesWebApp.Models.TutorSignInSignOutModel" is null and I don't know why.
Any help with this would be very helpful, thank you in advance.

New Topic/Question
Reply



MultiQuote





|