I have a database.
I added an edmx file using the connection string pointing to the already built database.
I created controller and view using scaffolding.
I want to modify the "Create" controller.
For that i added an "UserRegisterViewModel".
I tried to create a view out of "abcviewmodel" by right clicking on the action and selecting neccessary values in the "createview" dialog box.
But i got an error. "Unable to retrive metadata for... "
Here is my viewmodel
public class UserRegisterViewModel
{
public int UserId { get; set; }
[Required]
[Display(Name = "User name")]
public string Username { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm password")]
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
[Required]
public string Email { get; set; }
[Required]
public string TeamName { get; set; }
}
here is my action method in controller
public ActionResult Register()
{
return View();
}
I built my project many times but failed to create view.