I have an AJAX HtmlEditorExtender on my page with the ability to upload an image, however, when I try to upload an image, I get the following error:
JavaScript runtime error: Sys.ArgumentException: Unable to de-serialize. Data does not match valid JSON. Parameter Name: Data
I did some research on the error and saw that some people say that this may be because I am passing parameters to the page using the query string. I did this, so I deleted the parameters and the error still occurs, are there other reasons for this error?
The same Html Editor extension editor works on another page.
Following are my HTML and C #:
<asp:HtmlEditorExtender ID="HtmlEditorExtender3" runat="server" TargetControlID="txtAdminAddNote" OnImageUploadComplete="MyHtmlEditorExtender_ImageUploadComplete">
<Toolbar>
<asp:InsertImage />
</Toolbar>
</asp:HtmlEditorExtender>
<asp:TextBox runat="server" ID="txtAdminAddNote" TextMode="MultiLine" Width="96%" Height="200px"></asp:TextBox>
protected void MyHtmlEditorExtender_ImageUploadComplete(object sender, AjaxFileUploadEventArgs e)
{
string filePath = "~/Images/" + Path.GetFileName(e.FileName);
var ajaxFileUpload = (AjaxFileUpload)sender;
ajaxFileUpload.SaveAs(MapPath(filePath));
e.PostedUrl = Page.ResolveUrl(filePath);
}