Exemplo n.º 1
0
        public ActionResult Contact(ContactUs model)
        {
            if (!ModelState.IsValid)
            {
                ViewBag.Title = "Contact";
                ModelState.AddModelError("", "Please fill all required fields");
                return View(model);
            }

            //do something
            return RedirectToAction("Index");
        }
Exemplo n.º 2
0
 public ActionResult Contact()
 {
     ContactUs model = new ContactUs();
     ViewBag.Title = "Contact";
     return View(model);
 }