Can't update/insert if html on asp.NET

I am migrating my sites from classic asp to asp.net. I am having an issue with any update/insert action that contains HTML code. It works on the asp site, which is on the same server, and the same database.
I’m getting a runtime error on the server. Has anyone had this issue and overcome it? I’m sure it’s something I’m missing but I’m out of ideas. Any help would be appreciated. Thanks in advance

For testing, I have simplified it to one field that is varchar(max). Sending <p>Test</p> errors out and sending ‘Test’ works fine. I have also tried as a text field, text area, and summernote text.

The error I see is in the serverconnectForm.js and is listed below

this.xhr.open(method, action + (qs ? (action.indexOf('?') > -1 ? '&' : '?') + qs : ''));
        this.xhr.timeout = this.props.timeout * 1000;
        Object.keys(this.props.headers).forEach(function(header) {
            this.xhr.setRequestHeader(header, this.props.headers[header]);
        }, this);
        try { this.xhr.send(data); }
        catch (err) { this._done(err); }

Hello, this is not the error we need.
Please follow the docs explaining how to check the server action error returned from your server:

Thanks, It is definitely a .NET issue, not a Wappler one. As always thanks for the help. I’ll have to reseach how to overcome it. If anyone has already tackled this and could point me in the right direction I would appreciate it. In the meantime, I’ll follow the link on the error page and see what I can do.

Have you checked the link in the error description?

The error is thrown for security reasons. Not behind my computer at this moment, but there is a setting in the web.config to disable it. Just Google it.

Yes, thanks. I’m new to .net, I’m an old classic asp developer trying to get with the times LOL. I’m trying to figure out how to safely override it. If there are any .net gurus out there willing to point me in the right direction I would appreciate it. :grinning:

The article I found said to set validaterequest to false in the page directive. I have done this but it does not seem to work.

<%@ Page Language=“C#” ContentType=“text/html” ResponseEncoding=“utf-8” validateRequest=“false” %>

As an FYI for anyone else, here is what works. This code turns if off for the entire site, I will figure out how to set it up for only certain pages and will update this post when I do.

Web config changes to turn off validation Requests for .NET 4.x:

1 Like