Visual studio feeds

All Visual Studio blogs in one place


Enter your email address:

Delivered by FeedBurner

Increase your website traffic with



Anti-spam: How many eyes has a typical person?

Follow us on FB



AddThis Social Bookmark Button
So, I want potential clients to have to enter the least amount of info possible to get an account, to that end, I really don’t see the benefit of a username and email address, I’d rather just use the email address. Pretty easy, edit the Register.cshtml to remove all traces of a ‘username’ field… Edit the controller so that it now reads: model.UserName = model.Email; if (ModelState.IsValid) { /*...*/ } F5 and … no Hmmm, turns out the ModelState isn’t valid, and that’s down to the fact that I’ve left in the ‘Required’ bit
on the UserName property in the AccountModels RegisterModel class. //[Required] [Display(Name = "User name")] public string UserName { get; set; } Conceivably, I don’t really need that property at all, and can probably just do away with it later, but for now it can remain… Bigger fish to fry and all that… ...(Read whole news on source site)

Home : Blog List : xClave.Co.Uk : Registering…