我正在尝试通过使用 Jquery.param 将 JSON 编码到 URI 中来将 JSON 发送到服务器,但出现以下错误。
window.location.href = BriefExportPath+$.param(JSON.stringify({
title: $('.ui-dialog-title').text(),
items: ko.utils.arrayMap(Neptune.BriefCountrySection.SelectedCountries(), function (item) {
return item.ItemName
})
}))
[CustomAuthorize(Definitions.RoleSonarAdmin)]
public FileContentResult ExportCsv(string json)
{
var x = new System.Web.Script.Serialization.JavaScriptSerializer();
object obj = x.DeserializeObject(json);
//return File(Helpers.BriefCsvBytes.GetCsvBytes(items), "text/csv", title);
return null;
}
http://dev.neptune.local/Briefs/ExportCsv?0=%7B&1=%22&2=t&3=i&4=t&5=l&6=e&7=%22&8=%3A&9=%22&10=B&11=r&12=i&13=e&14=f&15=+&16=C&17=o&18=u&19=n&20=t&21=r&22=y&23=+&24=L&25=i&26=s&27=t&28=%22&29=%2C&30=%22&31=i&32=t&33=e&34=m&35=s&36=%22&37=%3A&38=%5B&39=%22&40=A&41=f&42=r&43=i&44=c&45=a&46=%22&47=%2C&48=%22&49=A&50=m&51=e&52=r&53=i&54=c&55=a&56=s&57=%22&58=%2C&59=%22&60=A&61=s&62=i&63=a&64=%22&65=%2C&66=%22&67=E&68=u&69=r&70=o&71=p&72=e&73=%22&74=%5D&75=%7D