Modifying Custom CreateUser method in mvc
I want to modify this custom method to have additional fiels like LastName,Email and Isapproved.
Here is my complete code for user registration
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using MVCLogin.Models;
namespace Recaptcha
{
namespace MVCLogin.Controllers
{
public class AccountsController : Controller
{
//
// GET: /Accounts/
public ActionResult Index()
{
return View();
}
[HttpGet]
public ActionResult Login()
{
return View();
}
[HttpPost]
public ActionResult Login()
{
return View();
}
[HttpGet]
public ActionResult Registeration()
{
if (!WebSecurity.Initialized)
{
WebSecurity.InitializeDatabaseConnection("MVCLoginConStr",
"Authentication", "UserId", "FirstName", autoCreateTables: true);
}
return View();
}
[HttpPost, RecaptchaControlMvc.CaptchaValidatorAttribute]
public ActionResult Register(Registration model, bool captchaValid)
{
if (!captchaValid)
{
ModelState.AddModelError("", "You did not type the verification
word correctly. Please try again.");
} //if
else
{
if (ModelState.IsValid)
{
// Attempt to register the user
MembershipCreateStatus createStatus;
Membership.CreateUser(model.FirstName,model.Password,
model.Email, null, null, true,null,out createStatus);
if (createStatus == MembershipCreateStatus.Success)
{
FormsAuthentication.SetAuthCookie(model.FirstName, false);
return RedirectToAction("Index", "Home");
}//if
else
{
ModelState.AddModelError(string.Empty, "Your error Message");
}//else
}//if
} //if
// If we got this far, something failed, redisplay form
return View(model);
} //register
public ActionResult Confirmation()
{
return View();
}
}
}
}//recpatcha
Thanks in advance for help..