I am returning a view from my action method which is called by ajax call. but in ajax success it is returning undefined object. What is the Problem?
$.ajax({
type: "GET",
url: url,
success: function (data) {
if (typeof (data) === 'undefined') {
alert("Error");
return;
}else {
$('#content').html(data);
}
},
error: function () {
alert("Error");
return;
}
});
Backend code is here :-
public ActionResult Index()
{
return view(); //Index is a view containing only "hello world"
}