Saving data with Razor
How do I save data with Razor? If I create a form to gather customer details how do I then create a n开发者_高级运维ew customer like Customer c = new Customer(){name= nameTextBox.Name} if there are no server side controls? With Razor it seems easy to display data, but I just don't understand how we collect data like we do with Web Forms?
In controller you get back the model in parameter:
public ActionResult Create(Customer model)
{
SaveCustomer(model);
return View();
}
精彩评论