开发者

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();
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜