Hi :) , i am using umbraco v 4.7 i made a page to send emails , the point I used a free rich text editor for the mail body,
the point is everytime i try to send an email the following error occurs
A potentially dangerous Request.Form value was detected from the client (ctl00$ctl00$ctl00$ContentPlaceHolderDefault$cp_content$MailerControl_2$RtbBody="<p>bla bla bla<br...").
i checked the error and all agreed that i must set
Ok , here's the deal in case someone passes by this post,
i couldn't find a way to set validaterequest from code behind ( it's impossible coz it's already set before the page is rendered and even in page_load you can set it , but it would be useless )
Disable Request Validation
Hi :) , i am using umbraco v 4.7
i made a page to send emails , the point I used a free rich text editor for the mail body,
the point is everytime i try to send an email the following error occurs
A potentially dangerous Request.Form value was detected from the client (ctl00$ctl00$ctl00$ContentPlaceHolderDefault$cp_content$MailerControl_2$RtbBody="<p>bla bla bla<br...").
i checked the error and all agreed that i must set
validateRequest="false"
http://www.asp.net/learn/whitepapers/request-validation
so when i go to the template and set
<%@ Master Language="C#" MasterPageFile="~/masterpages/umbMaster.master" AutoEventWireup="true" validateRequest="false" %>
gives the following error
Error parsing attribute 'validaterequest': Type 'System.Web.UI.MasterPage' does not have a public property named 'validaterequest'.
is there a solution for this :) ?
thanks
Hi,
Must set this property on Page level, not on Masterpage level. Either via code in your template or via web.config configuration change.
Cheers,
/Dirk
Hi Dirk, thanks but i'm not sure i got you :)
the
<%@ Master Language="C#" MasterPageFile="~/masterpages/umbMaster.master" AutoEventWireup="true" validateRequest="false" %>
is in the template file of the page, not the master one,
<httpRuntime requestValidationMode="2.0" />
<pages enableEventValidation="false" validateRequest="false"> ( which is a killer for website security)
didn't work too :(
Ok , here's the deal in case someone passes by this post,
i couldn't find a way to set validaterequest from code behind ( it's impossible coz it's already set before the page is rendered and even in page_load you can set it , but it would be useless )
so the only answer to this , is to encode the value of the text from the rich text editor
to do that check this link http://www.prodevtips.com/2008/10/21/jquery-plugin-html-decode-and-encode/
then using server.htmldecode the textbox.text, and setting mailmessage.htmlbody=true
you are going to send a successful html email ;)
is working on a reply...