locked
Internal Server Error 500 - Ajax - POST - wysiwyg RRS feed

  • Question

  • User-1536283485 posted

    I am using an example of wysiwyg. I get this error when characters are special.

    When doing a post with ajax, I get the HTML values typed on the screen.

    var formData = new FormData();
    var textarea = "Eu sou um editor de texto";
    formData.append("Wysiwyg", textarea);
    
    $.ajax({
                    cache: false,
                    type: "POST",
                    url: '/Account/Exemplo_Wysiwyg',
                    data: formData,
                    dataType: 'json',
                    contentType: false,
                    processData: false,
                    success: function (response) {
    
    }

    This way works I'm text editor works normally.

    However so I am text editor </ b> the Internal Server Error 500 issue occurs

    Console log:

    Failed to load resource: the server responded with a status of 500 (Internal Server Error)

    Any solution?

    Saturday, December 10, 2016 5:50 PM

All replies

  • User-1838255255 posted

    Hi matmiranda,

    Internal Server Error 500 - Ajax - POST - wysiwyg

    According to your description, as far as I know, this issue means something went wrong on the server's side.  It could be several things, but I would start by verifying that the URL and parameters are correct.  Also, make sure that whatever handles the request is expecting the request as a GET and not a POST.

    You can debugger your Ajax code, you can watch all request and response information.

    However so I am text editor </ b> the Internal Server Error 500 issue occurs

    I am not clear  about this issue, I hope you can give me more detail information!

    Best Regards,

    Eric Du

    Sunday, December 11, 2016 4:30 AM
  • User527778624 posted

    Hi,

    Try encoding text editor data:

    var res = encodeURI(textarea); formData.append("Wysiwyg", res);

    and then decode at serverside:

    http://stackoverflow.com/questions/3792458/how-can-i-decode-a-url-escape-string-in-c

    Sunday, December 11, 2016 1:22 PM