Storing Single Quotes Editor.

Storing Single Quotes Editor.

ClearwaterClearwater Posts: 17Questions: 4Answers: 0

Is there a way to single quotes in the database. Below is the hack I came up with to hide the single quotes escape .

                    int locationNameFormPostion = 1;
                    string @locationName = request.Form[locationNameFormPostion].Replace("'", "`").ToUpper();
                    editor.Field(new Field("LocationName"));
                    editor.Field("LocationName").SetValue(@locationName);

Answers

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin

    That is annoying. Its caused by the Microsoft AntiXSS library that Editor makes use of. It looks like it is being a bit over keen in how it escapes anything that could possibly relate to an XSS attach. To disable use .Xss( false ) on the field you want to stop that from happening on - e.g.:

    new Field("LocationName").Xss( false );
    

    More information about Xss protection in the Editor and DataTables manuals.

    Regards,
    Allan

This discussion has been closed.