我有以下操作的控制器: public ActionResult Create()
{
return View(new MyModel());
}
[HttpPost]
public ActionResult Create(MyModel model)
{
//Update database
...
//Pass the current model
我想使用ASP.NET MVC的驗證能力2(RC) 我有一個 視圖模型 public class CategoryPageViewModel
{
public int Id { get; set; }
[Required(ErrorMessage="Category name required")]
public string CategoryNam