Created
August 1, 2014 12:02
-
-
Save tamizhvendan/546d5c4d9476826dfe14 to your computer and use it in GitHub Desktop.
Using Ajax.BeginForm – ASP.NET MVC3 Ajax – Part III
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.ComponentModel.DataAnnotations; | |
| namespace UsingAjaxForms.Models | |
| { | |
| public class PersonalDetail | |
| { | |
| [Required] | |
| public string Name { get; set; } | |
| [Required] | |
| public string Email { get; set; } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Web.Mvc; | |
| using UsingAjaxForms.Models; | |
| namespace UsingAjaxForms.Controllers | |
| { | |
| public class PersonalDetailController : Controller | |
| { | |
| public ActionResult Create() | |
| { | |
| var personalDetail = new PersonalDetail(); | |
| return View(personalDetail); | |
| } | |
| [HttpPost] | |
| public string Create(PersonalDetail personalDetails) | |
| { | |
| return "Hi " + personalDetails.Name + "!. Thanks for providing the details."; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment