below is code snippet which return view to jquery function but i like to know how could i extract or get the view html and return to client end.
$(function(
You can make an AJAX call to the MVC action method, which will return the partial view as HTML. You then simply call the .html
jquery function to populate your div. Something like this:
$(function() {
$('#myddl').change(function() {
var url = $(this).data('url');
var value = $(this).val();
$.ajax({
type: "POST",
url: "@Url.Action("Foo", "Controller")", // replace with your actual controller and action
data: JSON.stringify({ value: value }),
success: function(result) {
$('#result').html(result);
}
});
});