Я хочу добиться этого:
public System.Web.Mvc.ActionResult ExposureGrid(Guid? id, decimal stdDev)
{
//return null;
try
{
var str = "<table border=1>";
str += "<tr><th>Date</th><th>Expected Credit Exposure</th><th>Max Credit Exposure</th></tr>";
str += "<tr><td>12/1/2010</td><td>100,000</td><td>50</td></tr>";
str += "<tr><td>12/2/2010</td><td>101,000</td><td>100</td></tr>";
str += "<tr><td>12/3/2010</td><td>102,000</td><td>150</td></tr>";
str += "<tr><td>12/4/2010</td><td>103,000</td><td>200</td></tr>";
str += "<tr><td>12/5/2010</td><td>104,000</td><td>250</td></tr>";
str += "<tr><td>12/6/2010</td><td>105,000</td><td>300</td></tr>";
str += "<tr><td>12/7/2010</td><td>106,000</td><td>350</td></tr>";
str += "</table>";
return Json(str);
}
catch (Exception e)
{
return Json(e.ToString());
}
}
Затем я беру этот Json и выставляю его на мой взгляд следующим образом:
$.ajax({
type: "POST",
url: "<%= Url.Action("ExposureGrid", "Indications") %> ",
dataType: "jsonData",
data: tableJSON,
success: function(data) {
existingDiv = document.getElementById('table');
existingDiv.innerHTML = data;
}
});
Но то, что показано на представлении в HTML, этоthis:
"uber3ctable border = 1 \ u003e \ u003eh \ u003cth \ u003e / u003e \ u003e \ u003e \ u003e \ u003e / u003e \ u003'0000000000000000000/ й \ u003e \ u003c / тр \ u003e \ u003ctr \ u003e \ u003ctd \ u003e12 / 1/2010 \ u003c / тд \ u003e \ u003ctd \ u003e100,000 \ u003c / тд \ u003e \ u003ctd \ u003e50 \ u003c / тд \ u003e\ u003c / тр \ u003e \ u003ctr \ u003e \ u003ctd \ u003e12 / 2/2010 \ u003c / тд \ u003e \ u003ctd \ u003e101,000 \ u003c / тд \ u003e \ u003ctd \ u003e100 \ u003c / тд \ u003e \ u003c / тр\ u003e \ u003ctr \ u003e \ u003ctd \ u003e12 / 3/2010 \ u003c / тд \ u003e \ u003ctd \ u003e102,000 \ u003c / тд \ u003e \ u003ctd \ u003e150 \ u003c / тд \ u003e \ u003c / тр \ u003e \ u003ctr\ u003e \ u003ctd \ u003e12 / 4/2010 \ u003c / тд \ u003e \ u003ctd \ u003e103,000 \ u003c / тд \ u003e \ u003ctd \ u003e200 \ u003c / тд \ u003e \ u003c / тр \ u003e \ u003ctr \ u003e \ u003ctd\ u003e12 / 5/2010 \ u003c / тд \ u003e \ u003ctd \ u003e104,000 \ u003c / тд \ u003e \ u003ctd \ u003e250 \ u003c / тд \ u003e \ u003c / тр \ u003e \ u003ctr \ u003e \ u003ctd \ u003e12 / 6/2010 \ u003c / тд \ u003e \ u003ctd \ u003e105,000 \ u003c / тд \ u003e \ u003ctd \ u003e300 \u003c / тд \ u003e \ u003c / тр \ u003e \ u003ctr \ u003e \ u003ctd \ u003e12 / 7/2010 \ u003c / тд \ u003e \ u003ctd \ u003e106,000 \ u003c / тд \ u003e \ u003ctd \ u003e350 \ u003c / тд \u003e \ u003c / tr \ u003e / table \ u003e "
Как мне это исправить?