Copied to clipboard

Flag this post as spam?

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


  • Saba Hakim 2 posts 22 karma points
    Oct 20, 2014 @ 15:54
    Saba Hakim
    0

    compilation error for Validation.RequireField

    Hi,

    I'm using Umbraco 7.1.6, and I'm trying to use Validation.RequireField for my contact form's fields. I'm getting the following error message:

    Compiler Error Message: CS0117: 'System.Web.Helpers.Validation' does not contain a definition for 'RequireField'

    for the codeline:

    Validation.RequireField("youremail", "Email is required.")

     

    I'd appreciate your help.

    Saba

     

     

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Oct 20, 2014 @ 16:03
    Dennis Aaen
    0

    Hi Saba and welcome to our.

    What if you are doing something like this:

    Validation.RequiredFields("youremail","Email is required.")

    I found someone that have the problem too, and it was because of misspelling.

    http://stackoverflow.com/questions/22176237/asp-net-mvc-error-system-web-helpers-validation-does-not-contain-a-definition

    Hope this helps,

    /Dennis

  • Saba Hakim 2 posts 22 karma points
    Oct 20, 2014 @ 16:25
    Saba Hakim
    0

    Thank you Dennis. I added the 's' at the end, I'm still getting the same error.

    Validation.RequireFields("youremail", "Email is required.");

    Is there anything else I'm missing?

    Thanks.

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Oct 20, 2014 @ 17:18
    Dennis Aaen
    0

    Hi Saba,

    What I see is that you are missing the d in RequiredFields, so try this:

    Validation.RequiredFields("youremail","Email is required.")

    Hope this helps,

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft