Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/arnab-developer/partialviewaspnet

Demo with partial view and AJAX call using ASP.NET MVC
https://github.com/arnab-developer/partialviewaspnet

asp-net-mvc jquery-ajax partial-views

Last synced: about 11 hours ago
JSON representation

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

Awesome Lists containing this project

README

        

# 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.
```csharp
public ActionResult Index()
{
IList products = Repositary.GetAll();
return PartialView(products);
}
```
This Index method has been called from Home -> Index view with jQuery and placed in html.
```javascript
$(document).ready(function () {
$("#ShowProducts").click(function () {
$.get("/Product/", function (data) { // Get data through AJAX call.
$("#Products").empty();
$("#Products").html(data); // Populate with data.
});
});
});
```