If I have a view that has a model, lets say Car..
@model Project.Car
inside that view I want to create a form that sends data to a new model
Your view is set up to use a model of type Project.Car
however your action method takes a model of type ViewModels.NewModel
, but also your model class posted is of type Add
?
Change them all to match (assuming Add
is correct):
View:
@model Add
Controller:
[HttpPost]
public PartialViewResult Add(Add model)