public ActionResult Contact(Models.ContactForm cf)
 {
     Models.ContactFormEntities db = new Models.ContactFormEntities();
     db.ContactForms.Add(cf);
     db.SaveChanges();
     return View("ThankYou");
 }
 public ActionResult Contact(Models.ContactForm cf)
 {
     //create a new connection to our database
     Models.ContactFormEntities db = new Models.ContactFormEntities();
     //add the contact info to the database
     db.ContactForms.Add(cf);
     //save changes to the db
     db.SaveChanges();
     //Redirect user to the thank you page
     return RedirectToAction("ThankYou");
 }
示例#3
0
 public ActionResult Contact(Models.ContactForm cf)
 {
     //create a new connection to our database
     Models.ContactFormEntities db = new Models.ContactFormEntities();
     //add the contact info to the database
     db.ContactForms.Add(cf);
     //save changes to the db
     db.SaveChanges();
     //Redirect user to the thank you page
     return(RedirectToAction("ThankYou"));
 }
示例#4
0
 public ActionResult Index(Models.ContactForm cf)
 {
     //establish a connection to the database
     var db = new Models.ContactFormEntities();
     //add our contact form to the database
     db.ContactForms.Add(cf);
     //save the changes to the database
     db.SaveChanges();
     //kick the user to the thank you page
     return RedirectToAction("ThankYou");
 }
 public ActionResult Contact(Models.ContactForm cf)
 {
     if (Request.IsAjaxRequest())
     {
         return PartialView();
     }
     Models.ContactFormEntities db = new Models.ContactFormEntities();
     db.ContactForms.Add(cf);
     db.SaveChanges();
     //redirect user to the thank you page
     return RedirectToAction("ThankYou");
 }
        public ActionResult Index(Models.ContactForm cf)
        {
            //establish a connection to the database
            var db = new Models.ContactFormEntities();

            //add our contact form to the database
            db.ContactForms.Add(cf);
            //save the changes to the database
            db.SaveChanges();
            //kick the user to the thank you page
            return(RedirectToAction("ThankYou"));
        }