Hi All,
I'm trying to bind my dropdownlist with the model class where it takes the values from my EF. I have the below code
public sealed class StoreRegistrationViewModel
{
public StoreRegistrationInfoModel StoreRegistrationAssociation { get; set; }
}
public class StoreRegistration
{
public IList StoreIdentity { get; set; }
public int StoreNumber { get; set; }
public string StoreName { get; set; }
public string City { get; set; }
public Address StoreAddress { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string StorePhone { get; set; }
public string EmailAddress { get; set; }
public string VerifyEmailAAddress { get; set; }
public string Comments { get; set; }
}
[ActionName("Index")]
public ActionResult StoreRegistration()
{
StoreRegistration s = new StoreRegistration();
s.StoreIdentity = retailIdentityRepository.GetActiveRetailIdentities();
//ViewBag.RetailIdentity = retailIdentityRepository.GetActiveRetailIdentities();
return View("Index");
}
@using Newtonsoft.Json;
@model Mol2.Website.Models.StoreRegistration.StoreRegistrationViewModel
@{
ViewBag.Title = "Index";
}
@Html.DropDownList("retailIdentityDDL",x => x.StoreRegistrationAssociation.StoreIdentity, "Select")
@Html.ValidationMessageFor(x => x.StoreRegistrationAssociation.StoreIdentity)
I'm getting an exception unable to cast IList to IEnumerable i'm new to MVC
Any Suggesstions or help would be appreciated
Join Hands Change lives
Thanks & Regards
Straight Edge Society