neel k

neel k

  • NA
  • 143
  • 136.4k

MVC dropdown viewbag selecte value

Apr 30 2015 1:12 PM
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. 
 

Answers (8)