Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 1.4 KB

File metadata and controls

19 lines (11 loc) · 1.4 KB

Populate MVC listbox using jquery getjson and jsonresult

This article shows how you can populate MVC Listbox using jQuery and JSONResult. It uses static values and also shows with model values which can use database values.

By using this repository code you will save Categories as JSON file and read it using jQuery getJSON method. This also helps you to read from Controller Action method that returns JSONResult.

Files

  1. Categories JSON file - has list of Categories in JSON format.
  2. Index HTML View - shows a ListBox filled from the values returned by JSONResult.
  3. Controller - Returns JSONResult to View.

ASP.NET MVC List box will be shown as

ASP.NET MVC List Box

For more info see - Populate ASP.NET MVC List box using jQuery getJSON or JSONResult