Skip to content

About

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

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

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