Попробуйте таким образом, это может помочь вам.
$.ajax({
type: "POST",
url: "/Client/ShowClient",
data: "ClientCode=" + code/*{ "ClientCode": code }*/, //First item has latest ID
contentType: "application/json; charset=utf-8",
dataType: "html",
success: function (data) {
$('#dialog').html(data);
},
failure: function (response) {
alert(response.responseText);
},
error: function (response) {
alert(response.responseText);
}
});
});
В контроллере
[HttpPost]
public ActionResult ShowClient(string ClientCode)
{
if (ClientCode == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
ClientViewModel clientViewModel = this.Service.FindByClientCode(ClientCode);
if (clientViewModel == null)
{
return HttpNotFound();
}
return View("ShowClient", clientViewModel);
}
для получения более подробной информации см. Рабочий пример