ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
AjaxDropdown do not work fine
Title:
B
I
{code}
?
We are testing awesome control, we are working with Mvc5MinSetup Project. We include the following code in the index view: @Html.Awe().AjaxDropdown("Fruit") And in the home controller we include this code: public class FruitAjaxDropdownController : Controller { // private ASPIntranetWeb db = new ASPIntranetWeb(); public ActionResult GetItems(int? v) { return Json( new List<SelectableItem> { new SelectableItem(1,"Mango"), new SelectableItem(1,"Banana"), new SelectableItem(1,"Apple"), } ); // return Json(db.FLG_Empresas.Where(x => x.RegistrateID == User.Identity.Name).Select(x => new SelectableItem(x.IdEmpresa, x.Empresa, v == x.IdEmpresa))); } When we run the aplication, in the list do not display values, could you give me some idea in order to solve the problem.
Save Changes
Cancel
Juan Equiz
asked at 05 Aug 2015
the code you wrote works for me ( I tried it in Mvc5MinSetup ) try to use KeyContent instead ( this is the new way ) new KeyContent(x.IdEmpresa, x.Empresa) try downloading the SimpleDemo, it's a one page demo, and it has AjaxDropdown on that page ( http://aspnetawesome.com/Download/SimpleDemo )
at 06 Aug 2015
Omu
Thanks a lot, this demo is very clear and easy to use.
at 06 Aug 2015
Juan Equiz
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK