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 DuranoRank #238 · 10.3K reputationPosted Apr 30, 2015, 9:55 AM EDT
neel k143 reputationPosted Apr 30, 2015, 10:18 AM EDT
Thanks for reply. I want store selected ddl value into database. and I need to compare old value with new value.
Thanks
Vincent Maverick DuranoRank #238 · 10.3K reputationPosted Apr 30, 2015, 10:25 AM EDT
neel k143 reputationPosted Apr 30, 2015, 10:26 AM EDT
neel k143 reputationPosted Apr 30, 2015, 10:31 AM EDT
Vincent Maverick DuranoRank #238 · 10.3K reputationPosted Apr 30, 2015, 10:44 AM EDT
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 k143 reputationPosted Apr 30, 2015, 11:20 AM EDT
There is no ViewData item of type 'IEnumerable
Vincent Maverick DuranoRank #238 · 10.3K reputationPosted Apr 30, 2015, 11:55 AM EDT