Esempio 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");
        }
Esempio n. 2
0
 public ActionResult Contact()
 {
     ContactUs model = new ContactUs();
     ViewBag.Title = "Contact";
     return View(model);
 }