Skip to content

Instantly share code, notes, and snippets.

@tamizhvendan
Created August 1, 2014 12:02
Show Gist options
  • Select an option

  • Save tamizhvendan/546d5c4d9476826dfe14 to your computer and use it in GitHub Desktop.

Select an option

Save tamizhvendan/546d5c4d9476826dfe14 to your computer and use it in GitHub Desktop.
Using Ajax.BeginForm – ASP.NET MVC3 Ajax – Part III
using System.ComponentModel.DataAnnotations;
namespace UsingAjaxForms.Models
{
public class PersonalDetail
{
[Required]
public string Name { get; set; }
[Required]
public string Email { get; set; }
}
}
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