I'm demoing the ASPxHTML Edit component and I've come across an Issue.
I've created a test table with 2 fields and I'm trying to save the html to an NVARCHAR(MAX) field. If I hardcode html directly into the component, it saves perfectly. If I edit the html in the control and then try and save it, it does not reflect the changes I've made. I have included the test project I was using.
Am I doing something wrong, or is this a problem with the component?
I also get the following exception after a few minutes of running the site and trying to switch between design, html and preview windows:
"A potentially dangerous Request.Form value was detected from the client (ctl00$MainContent$txtTestText"
Also, If I place more than one component on the page, the site has trouble displaying.
We have closed this ticket because another page addresses its subject:
ASPxUploadControl - not working on a page that has a masterpage
Hello Shane,
Thank you for sending your test project to me. I've reproduced this problem. However, I need to discuss this behavior with our developers, so I'll still leave this report as active. We'll answer you as soon as possible. We're sorry for the delay.
Regards,
Mike
Hello Shane,
Our developers have examined your code and found out that you don't set the form.id property on the master page. By design, as there are several forms on a page, our script functions get a reference to an element stored inside the form by using its id. It's impossible to find controls if the form's id is not set, and an exception is thrown.
Therefore, to overcome your issue, please set the form id in the Site.master:
<form runat="server" id="form1">
Thanks,
Marion
Brilliant! Adding in the ID on the form worked 100% as far as getting the control html to save to the database. That masterpage is a default masterpage that was generated when I created a new ASP.NET webApplication.
I still however get the following error when I attampt to save a second time or switch between design/html/preview mode of the ASPxHTML Editor control
A potentially dangerous Request.Form value was detected from the client (ctl00$MainContent$txtTestText="<strong>Hello <span …").
I've included a screen shot of the error.
Hello Shane,
I see that you try to insert html code in the ASPxHtmlEditor. This is a known issue related to ASP.NET features. You can check it by replacing our control with standard textarea. If you need to pass html markup on the server side, please switch off the validateRequest in the web.config. To learn more please see:
A potentially dangerous Request.Form value was detected from the client: ASPxComboBox Text with <tag>, integer value
"A potentially dangerous Request.Form value was detected from the client" - Problems submitting texts with accented characters
How To: Prevent Cross-Site Scripting in ASP.NET
A potentially dangerous Request.Form value was detected from the client
Thanks,
Marion