1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Custom control causes "A potentially dangerous Request.Form value was detected from the client"

Custom control causes "A potentially dangerous Request.Form value was detected from the client"

2 posts, 0 answered
  1. Sharon
    Sharon avatar
    28 posts
    Registered:
    29 Jul 2008
    01 Jun 2010
    Link to this post
    I am developing a custom control that includes a free text box that will accept HTML.  When I run it if there is a link in the data I get this message:

    A potentially dangerous Request.Form value was detected from the client

    I don't want to turn off validation for all pages. Just for the page that uses this control. I know on the page you can set
    <%@ Page Language="VB" ValidateRequest="false" ...

    but how do I set this for the page when I'm just dragging my control onto the page I built in Sitefinity?



  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    01 Jun 2010
    Link to this post
    Hello Sharon,

    It is not possible to disable the event validation only for a certain page. The EnableEventValidation property is  set after the page is initialized. You cannot set the EnableEventValidation property in code of a control. You could bypass validation for a specific ASP.NET Server control by setting the control's CausesValidation property to false. Disabling event validation could result in the way that the postback could be constructed and this  could have an unintended effect. If this does not help, you could use an external ASP.NET web page which is located in your project and you will use it with your form. This will allow you to set the enabledEventValidation attribute of the @ Page directive.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
2 posts, 0 answered