Copied to clipboard

Flag this post as spam?

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


  • Kiran 17 posts 109 karma points
    Feb 08, 2021 @ 11:21
    Kiran
    0

    In the umbraco 8 we did't find 'UmbracoHelper' does not contain a definition for 'Web' and no accessible extension method'

    Severity Code Description Project File Line Suppression State Error CS1061 'UmbracoHelper' does not contain a definition for 'Web' and no accessible extension method 'Web' accepting a first argument of type 'UmbracoHelper' could be found (are you missing a using directive or an assembly reference?) Please help me.

  • Dhanesh Kumar MJ 165 posts 521 karma points MVP c-trib
    Feb 08, 2021 @ 16:22
    Dhanesh Kumar MJ
    0

    Hey,

    We can use Umbraco Helper in the controller like below, if you want to use the helper in any services then you can pass it from the controller.

      public async Task<HttpResponseMessage> Gender()
        {
    //Umbraco - you can access umbracohelper from Controller (and it's referenced from Umbraco.Web)
        return   Umbraco.GetDictionaryValue("Gender Male", "Male")
    
            }
    

    Regards DK ;)

Please Sign in or register to post replies

Write your reply to:

Draft