public ContactUsForm() { statesList = new SelectList(new List<SelectListItem>(), "stateID", "state"); provinceList = new SelectList(new List<SelectListItem>(), "provinceID", "province"); } public SelectList statesList { get; set; } public SelectList provinceList { get; set; } private string _unCandidateFirstName; [Required(ErrorMessage = "Please type your name")] public string unCandidateFirstName { get { return _unCandidateFirstName; } set { _unCandidateFirstName = value; } } private string _unCandMobilePhone; [Required(ErrorMessage = "Please type your mobile number")] public string unCandMobilePhone { get { return _unCandMobilePhone; } set { _unCandMobilePhone = value; } } private string _unCandEmail; [Required(ErrorMessage = "Please type your email")] public string unCandEmail { get { return _unCandEmail; } set { _unCandEmail = value; } } private string _unCandLandLine; public string unCandLandLine { get { return _unCandLandLine; } set { _unCandLandLine = value; } } private int _countryID; [Display(Name = "Country")] public int countryID { get { return _countryID; } set { _countryID = value; } } public SelectList countries { get { return LoadCountries(); } } private int _stateID; [Display(Name = "State")] public int stateID { get { return _stateID; } set { _stateID = value; } } private int _provinceID; public int provinceID { get { return _provinceID; } set { _provinceID = value; } } private string _unCandEnquiry; public string unCandEnquiry { get { return _unCandEnquiry; } set { _unCandEnquiry = value; } } private Guid _userID; public Guid userID { get { return _userID; } set { _userID = value; } } private int _referenceId; public int referenceId { get { return _referenceId; } set { _referenceId = value; } } private SelectList LoadCountries() { SM_WEB.Models.SMWebDefaultConnection objSMWebDefaultConnection = new SM_WEB.Models.SMWebDefaultConnection(); var countryList = objSMWebDefaultConnection.smConn.tblCountries.Where(c => c.recordActive == true).Select(c => new { c.countryID, c.country }).ToList(); return new SelectList(countryList, "countryID", "country"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)