Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Partial view and AJAX call

Demo with partial view and AJAX call using ASP.NET MVC.

Index action method of Product controller returns partial view.

public ActionResult Index()
{
    IList<Product> products = Repositary.GetAll();
    return PartialView(products);
}

This Index method has been called from Home -> Index view with jQuery and placed in html.

$(document).ready(function () {
    $("#ShowProducts").click(function () {
        $.get("/Product/", function (data) { // Get data through AJAX call.
            $("#Products").empty();
            $("#Products").html(data); // Populate with data.
        });
    });
});

About

Demo with partial view and AJAX call using ASP.NET MVC

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages