Make sure to escape only the characters `"` and `\` according to the specification (refer to here or here). Other characters may be escaped as needed, while an unescaped `'` character should not be considered an error. There could be another reason for the "Invalid JSON Parser error" that you encounter.
To avoid errors, include a more comprehensive JavaScript code snippet showing how jqGrid is used, along with the ASP.NET MVC controller action code or a complete JSON response from the server. Utilize libraries like Json.NET to ensure well-formatted JSON data.
Ensure to use the `autoencode: true` option in jqGrid to display text data accurately. Additionally, make use of the `datatype: "json"` and `jsonReader` options as per the documentation found here. Simply producing correctly formatted JSON or XML data might not suffice; including jqGrid options that specify the data format precisely could be necessary.
UPDATED: Validate your JSON data using tools like jsonlint.org as the data appears to be corrupted. Pay attention to syntax errors such as:
- Using `"cell": ""` instead of `"cell": [""]`
- Misplacement of `}, "i": 1,` rather than `}, {"i": 1,`
- Inconsistencies like `"Sample\value2"` instead of `"Sample value2"` or `"Sample\\value2"`
- Errors in formatting URLs like `"http://Googole.com/Dashboard.aspx?ParcelNbr={SITE_APN}&ABC=\XYZ"` which should be corrected to `"http://Googole.com/Dashboard.aspx?ParcelNbr={SITE_APN}&ABC=XYZ"`
- Improper handling of special characters in values such as `"Sample & value3""` which should be rectified to `"Sample & value3"`
It is also recommended to use `id` property instead of `i` property in the JSON response for jqGrid compatibility. Refer to the jqGrid documentation for guidance on proper data format expectations. A fixed version of the JSON response should resemble the following:
{
"total": 1,
"page": 1,
"records": 3,
"rows": [
{
"id": 0,
"cell": [
"",
"1",
"1",
"DesSinglApostropAndURLhasEnterKeyChar",
"Samp'le value",
"http://google.com/Dashboard.aspx?ParcelNbr= {SITE_APN}",
"False",
"",
""
]
},
{
"id": 1,
"cell": [
"",
"2",
"2",
"DesWithSlashAndURLwithSlash",
"Sample value2",
"http://Googole.com/Dashboard.aspx?ParcelNbr={SITE_APN}&ABC=XYZ",
"False",
"",
""
]
},
{
"id": 2,
"cell": [
"",
"3",
"3",
"DesWithAmpersand",
"Sample & value3",
"http: //Googole.com",
"False",
"",
""
]
}
]
}
Consider reviewing examples of ASP.NET MVC usage with jqGrid and adjust your server-side code accordingly.