Copied to clipboard

Flag this post as spam?

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


  • James 5 posts 75 karma points
    Mar 14, 2016 @ 18:25
    James
    0

    RequireField Validation Helper not working in Umbraco 7

    Hi, I'm new to Umbraco so please bear with me. Umbraco Version is 7.3.1

    I'm aiming to do some quick Razor validation of a form field within a view, inspired by this article: http://www.asp.net/web-pages/overview/ui-layouts-and-themes/validating-user-input-in-aspnet-web-pages-sites

    This line gives an error...

    Validation.RequireField("comments", "This field is required");

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

    • I have WebMatrix 3 installed
    • Looking at various articles, I don't think it's a typo
    • I have allowed client side validation in web config
    • I have tried overwriting bin and app_data files (where possible)
    • Interestingly I can get output from Validation.Summary

    Is this approach still a good one? I appreciate I probably ought to be looking at setting this form up via a Surface Controller, but for a simple requirement, this seemed like a good/fast place to start.

    Would be very grateful for any advice, I've spent an entire day on it and have got nowhere. Thanks.

Please Sign in or register to post replies

Write your reply to:

Draft