Hi all
Register.cshtml
class="form-group">
@Html.LabelFor(m => m.Gender, new { @class = "col-md-2 control-label" })
<div class="col-md-10">
@Html.DropDownList("selection_Gen", new List<SelectListItem >() { new SelectListItem { Text = "MALE", Value = "MALE" }, new SelectListItem { Text = "FEMALE", Value = "FEMALE" } }, new { @class = "form-control" })
</div>
AccountController.cs
var user = new ApplicationUser
{
UserName = model.Email,
Email = model.Email,
Fullname = model.Fullname,
Img_Name = fileName,
MobileNo = model.MobileNo,
GPF_CPF = model.GPF_CPF,
Address1 = model.Address1,
Address2 = model.Address2,
City_Village = model.City_Village,
Takula = model.Takula,
District = model.District,
Pincode = model.Pincode,
UnitNo = model.UnitNo,
Gender = model.Gender,
DOB = model.DOB,
DOJ = model.DOJ,
DOR = model.DOR,
ECLASS = model.ECLASS,
Desig = model.Desig,
EMPNO = model.EMPNO
}
accountviewModel.cs
[Display(Name = "Gender")]
[DataType(DataType.Text)]
public string Gender { get; set; }
when I subumit from its pass null instead of selected value of the dropdown.
Thanks