I have some records. Upon clicking on every record there information needs to display in an accordion.
That information is supposed to fetch from database dynamicall
this is a basic approach when you need submit some form and render the partial view as result
function GetView(){
if ($('#MyHtmlForm').valid()){
$.ajax(
{
type: "POST",
url: $('#MyHtmlForm').attr("action"),
data: $('#MyHtmlForm').serialize(),
success: function(result) {
//Render the partial view
}
},
error: function(req, status, err) {
//handle the error
}
});
}
}
and this for get basic details of row via json format, so use javascritp to generate the html
function GetSomeData() {
var cod = $('.row').val();
$.getJSON('@Url.action("ActionName","Controller")', { cod: cod }, function (result) {
//Render data
});
}