Refresh Partial View

capri

Active member
Joined
Jun 16, 2015
Messages
42
Programming Experience
5-10
[FONT=&quot]Hi,[/FONT]

[FONT=&quot]I am developing a Web Application with Asp.NET MVC5. As I dont have much experience, I am stuck with a functionality using JQuery and Partial View.[/FONT]

[FONT=&quot]I have a Side Menu as a partial view in a page. This partial view contains a DropdownList which is populated from model, and it works fine. However, I want to display a list of items from the db when the dropdown is selected, based on the selection, which is not working. [/FONT]

[FONT=&quot]Hide Copy Code[/FONT]
Partial View (_UserPartialView)
$('#dropdown').change(function(){
var item = $(this).val();
$.get("/Controller/GetItems/" + item, function(data)
{
('#target').html(data);
});

Controller

public ActionResult (int id)
{
var test = db.Users.Where(e => e.cId = id);

return PartialView(" _UserPartialView", test);
}
[FONT=&quot]Please help.[/FONT]

[FONT=&quot]Thanks[/FONT]
 
Back
Top Bottom