コード例 #1
0
        public ActionResult Contact(Contact model)
        {
            model.CreateDate = DateTime.Now;
            var result = new ContactF().Insert(model);

            return(View("Index", 1));
        }
コード例 #2
0
        public ActionResult contact(string Name, string Email, string Message)
        {
            Contact contact = new Contact();

            contact.Name    = Name;
            contact.Message = Message;
            contact.Email   = Message;
            try
            {
                var id = new ContactF().Insert(contact);
                return(View("Home/Index"));
            }
            catch
            {
                ModelState.AddModelError("", "Lỗi");
                return(View("Index", "Contact"));
            }
            // return View("Index","Home");
        }