CODE LIBRARY: MVC Ajax Partial View Load

Used this while building a primary search View that loads results into a partial view.

$.ajax(
{
type: “GET”, //HTTP GET Method
url: ‘/Controller/Method’,
cache: false, 
data: { //Passing data
param1: value1
, param2: value2
}
})
.success(function (result) {
     $(‘#divTarget’).html(result);
});

Leave a Reply

Discover more from Dax Judy

Subscribe now to keep reading and get access to the full archive.

Continue reading