Пример #1
0
        public async Task <ActionResult> ContactAjax(Models.Contact task)
        {
            if (ModelState.IsValid)
            {
                var data1 = task.Name + ", " + task.Email;

                var bRet = task.SendEmail();
                TempData["Status"] = "emailSent";

                return(PartialView("contactResult", task));
            }
            else
            {
                TempData["Status"] = "Message err from controller";
                return(PartialView("ContactAjax", task));
                //return PartialView("contactResult", task);
            }
        }
Пример #2
0
        public async Task <ActionResult> ContactAjax(Models.Contact task)
        {
            if (ModelState.IsValid)
            {
                var data1 = task.Name + ", " + task.Email;

                var bRet = task.SendEmail();
                TempData["Status"] = "emailSent";// itime request session object

                return(PartialView("ContactAjax", task));
                //return RedirectToAction("ContactAjax", task);// the page will be opened with get
            }
            else
            {
                TempData["Status"] = "Message err from controller";
                return(PartialView("ContactAjax", task));
                //return PartialView("contactResult", task);
            }
        }