using WebApplication1.Models;
 
 namespace WebApplication1.Controllers
 {
     public class HomeController : Controller
     {
         public ActionResult Index(User model)
         {
             if (ModelState.IsValid) {
                 ViewBag.Mesg = "ModelState.IsValid => OK";
             }
             else {
                 ViewBag.Mesg = "ModelState.IsValid => NO";
             }
 
             ModelState.AddModelError("Foo", "Foo is always Error");
 
             return View(model);
         }
     }
 }

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS