Copied to clipboard

Flag this post as spam?

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


  • badigard 7 posts 38 karma points
    Apr 24, 2014 @ 09:43
    badigard
    0

    Right way to create a validation class

    Hi all,

    Need you help in creating a custom validation class for Umbraco properties.

    The class will get a Node ID, check if it's valid and return a string to the image.

    Something like:

            public static string GetImageLink (int link) {

                if (link != null && link > 0 )           {

                   var imageLink = umbraco.Media(link).umbracoFile; }

           }

    Questions:

    1. Where should this class be created? it's a MVC project

    2. What libraries should I add (and how) so commands like umbraco.Media / uQuery.GetNode / Node.GetProperty will work?

    Thanks.

Please Sign in or register to post replies

Write your reply to:

Draft