Hi,
In my MVC 5 application one drop down list. below is my code.
var appWorld = from w in sp_app()
select w;
ViewBag.world = new SelectList(appWorld, "id", "name", ApplicationWorlds); // world
@Html.DropDownList("world")
if (Edit_old.world_id !=app_new.world_id && external_applications_new.world_id != null)
{
string worldid = "world_id" + "--->" + Edit_old.world_id + "<---" + app_new.world_id;
Edit_old.world_id = app_new.world_id;
list.Add(worldid);
}
Its not working. can some one help.
Loading
Vincent Maverick DuranoPosted Apr 30, 2015, 3:55 PM
neel kPosted Apr 30, 2015, 3:20 PM
There is no ViewData item of type 'IEnumerable
Vincent Maverick DuranoPosted Apr 30, 2015, 2:44 PM
I'd suggest you to debug your code and set a break point to figure out why it's not working. If you are new to MVC then please read some tutorials on how to interact with database using MVC. There's a bunch of articles that demonstrate that. Just look for it at google.
neel kPosted Apr 30, 2015, 2:31 PM
neel kPosted Apr 30, 2015, 2:26 PM
Vincent Maverick DuranoPosted Apr 30, 2015, 2:25 PM
neel kPosted Apr 30, 2015, 2:18 PM
Thanks for reply. I want store selected ddl value into database. and I need to compare old value with new value.
Thanks
Vincent Maverick DuranoPosted Apr 30, 2015, 1:55 PM