---
title: "Dynamically populate the drop-down using jQuery in ASP.Net MVC3"  
description: "Dynamically populate the drop-down using jQuery in ASP.Net MVC3"  
author: "Anonymous User"  
published: 2015-02-11  
updated: 2015-02-11  
canonical: https://www.mindstick.com/forum/12954/dynamically-populate-the-drop-down-using-jquery-in-asp-dot-net-mvc3  
category: ".net"  
tags: [".net", "jquery", "mvc3"]  
reading_time: 1 minute  

---

# Dynamically populate the drop-down using jQuery in ASP.Net MVC3

I have a [model](https://yourviews.mindstick.com/view/81334/america-is-reopening-after-corona-lockdown-but-on-swedish-model)

```
public class City{    public string Name { get; set; }    public int ID { get; set; }}
```

\

## Replies

### Reply by Anurag Sharma

**In your controller:**\

```
[HttpGet]    public virtual JsonResult LoadInfo()    {        var query = _repository.GetInformation(); //Here you return the data.         return Json(query, JsonRequestBehavior.AllowGet);    }
```

\
**Then in your view:**\
<select id="info"></select>**Then you load the drop down using jQuery**

```
function LoadInfo() {    $.getJSON("@Url.Action(MVC.ControllerName.MethodName())", null,        function (data) {            $("#info").empty();            $.each(data, function () {                $("#info").append($("<option />").val(this.Id).text(this.Name));            });        });}
```

This assumes that Id and Name are properties of your object. You could use ID and Name depending on which drop down you're loading. Hope this helps,\


---

Original Source: https://www.mindstick.com/forum/12954/dynamically-populate-the-drop-down-using-jquery-in-asp-dot-net-mvc3

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
