Facebook

Friday, 27 July 2012

Save Controller

[HttpPost]
           public ActionResult EmailSubcribe_Action(string txt_emailsubscribe)
           {
               EntityName obj_EmailSubscribe = new EntityName();
               if (txt_emailsubscribe != null)
               {
                   tbl_EmailSubscriber objsubscribe = new tbl_EmailSubscriber();
                   objsubscribe.Email_Subscribe = txt_emailsubscribe;
                   EntityName obj = new EntityName();
                   obj.tbl_EmailSubscriber.AddObject(objsubscribe);
                   obj.SaveChanges();
                   return RedirectToAction("Index", "Home");
               }
               else
               {
                   return RedirectToAction("Index", "Home");
               }

No comments:

Post a Comment