User-1634604574 posted
controller
public JsonResult read_file_css(string js, string css)
{
SqlCommand com = new SqlCommand("read_file_css", con);
com.CommandType = CommandType.StoredProcedure;
// com.Parameters.AddWithValue("@js", js);
com.Parameters.AddWithValue("@css", css);
SqlDataAdapter da = new SqlDataAdapter(com);
DataSet ds = new DataSet();
da.Fill(ds);
List<currency_Detail> listreg = new List<currency_Detail>();
foreach (DataRow dr in ds.Tables[0].Rows)
{
listreg.Add(new currency_Detail
{
// JS = dr["JS"].ToString(),
CSS = dr["CSS"].ToString(),
});
}
return Json(listreg, JsonRequestBehavior.AllowGet);
}
view
$.ajax({
type: 'GET',
url: '/Print_Format/read_file_css',
data: {
css: $("#name").val(),
},
success: function (response) {
data = $.map(response, function (item, a) {
$("#custom_css").val(item.CSS)
});
}
})
i get this error
Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for
more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.