locked
ValidateRequestMode is .NET 4.5 project RRS feed

  • Question

  • User1007388346 posted

    In a .net 4.5 web project i set the property ValidateRequestMode="Disabled" in a TextBox and in WebConfig requestValidationMode=4.5

    When I try to build I get the following error.

    System.Web.UI.WebControls.TextBox' does not contain a definition for 'ValidateRequestMode' and no extension method 'ValidateRequestMode' accepting a first argument of type 'System.Web.UI.WebControls.TextBox' could be found (are you missing a using directive or an assembly reference?) 

    But if I execute the WebSite on IIS it is OK!

    Is there something missing in Visual Studio (2012)?

    Thursday, July 4, 2013 2:19 PM

Answers

  • User1007388346 posted

    Found the problem:

    In web.config should be set 

    targetFramework="4.5" instead of 4.0

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 4, 2013 2:29 PM

All replies

  • User1007388346 posted

    Found the problem:

    In web.config should be set 

    targetFramework="4.5" instead of 4.0

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 4, 2013 2:29 PM
  • User-166373564 posted

    Hi,

    Found the problem: In web.config should be set  targetFramework="4.5" instead of 4.0

    Glad that you've solved your problem by yourself , and it is very appreciated to share your solution to us. It will be helpful for others, and welcome to post your question on asp.net forums in your future programming,

    Regards

    Thursday, July 4, 2013 9:04 PM