Hi team
I want an example in asp.net mvc form, where if i use dropdownlist it will show me list of all countries in the world including their zip code. Do i use enum to do this in asp.net mvc? please advice me and show me some examples surely i will work it out the rest, thanks mates.
Asma KhalidRank #160 · 14.7K reputationPosted Mar 13, 2020, 8:55 AM EDT
Vishvjit ShindeRank #3,119 · 459 reputationPosted Mar 12, 2020, 10:48 PM EDT
List countries =new List(2);var dtList = from ctry in objContext.Details select ctry; // Source of Countryforeach (var dt in dtList) {return View(dtList);var CountryItems = new ListSelectListItem>();CountryItems.Add(new SelectListItem { Text = String.Empty, Value = String.Empty });foreach (var name in ViewBag.Names)CountryItems.Add(new SelectListItem { Text = name, Value = name });@Html.DropDownList("dropDownList", CountryItems)Narendhiran P130 reputationPosted Mar 12, 2020, 10:50 PM EDT
Guest UserRank #877 · 2.5K reputationPosted Mar 12, 2020, 11:27 PM EDT
Vishvjit ShindeRank #3,119 · 459 reputationPosted Mar 13, 2020, 12:23 AM EDT
Guest UserRank #877 · 2.5K reputationPosted Mar 13, 2020, 12:58 AM EDT
Vishvjit ShindeRank #3,119 · 459 reputationPosted Mar 13, 2020, 1:04 AM EDT
Asma KhalidRank #160 · 14.7K reputationPosted Mar 13, 2020, 1:23 AM EDT
Guest UserRank #877 · 2.5K reputationPosted Mar 13, 2020, 1:39 AM EDT
Avnish KumarRank #1,003 · 2K reputationPosted Mar 13, 2020, 2:42 AM EDT
Guest UserRank #877 · 2.5K reputationPosted Mar 13, 2020, 3:29 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts