Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • metalforgood 36 posts 55 karma points
    Oct 19, 2011 @ 11:56
    metalforgood
    0

    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

     

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Oct 19, 2011 @ 12:04
    Dirk De Grave
    0

    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

  • metalforgood 36 posts 55 karma points
    Oct 19, 2011 @ 12:10
    metalforgood
    0

    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 :(

  • metalforgood 36 posts 55 karma points
    Oct 20, 2011 @ 19:01
    metalforgood
    0

    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 ;)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies