Copied to clipboard

Flag this post as spam?

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


  • Leena 29 posts 100 karma points
    Apr 03, 2013 @ 09:23
    Leena
    0

    can not retrieve dictionary item from surface controller

    Hi all,

    I have my website in 2 languages, for login I am using SurfaceConrtoller. To render error message according language I am using dictionary Item as umbraco.library.getdictionaryitem("ErrorMessage")

    but it is not returning me any value, just a blank string.

    I am using Umbraco 6.0

  • Fuji Kusaka 2203 posts 4220 karma points
    Apr 03, 2013 @ 09:27
    Fuji Kusaka
    0
    @umbraco.library.GetDictionaryItem("ErrorMessage")
  • Leena 29 posts 100 karma points
    Apr 03, 2013 @ 09:30
    Leena
    0

    hi Fuji ,

    I already have tried that one but that is also not working :(

  • Leena 29 posts 100 karma points
    Apr 03, 2013 @ 09:30
    Leena
    0

    hi Fuji ,

    I already have tried that one but that is also not working :(

  • Fuji Kusaka 2203 posts 4220 karma points
    Apr 03, 2013 @ 09:32
    Fuji Kusaka
    0

    Hmmm,

    Ok did you add another language under settings > languages ? 

    If not add another one, and for this to work you will need to set hostnames under each of your default homepage.

  • Leena 29 posts 100 karma points
    Apr 03, 2013 @ 10:23
    Leena
    0

    yes .. I have added 2 lang under languages

  • Fuji Kusaka 2203 posts 4220 karma points
    Apr 03, 2013 @ 11:14
    Fuji Kusaka
    0

    Can you post your entire code ? you did set the hostnames as well right ?

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Apr 03, 2013 @ 11:37
    Dave Woestenborghs
    100

    Try using this code :

     @Umbraco.GetDictionaryValue("More")

    I had the same problem. More info here : http://our.umbraco.org/forum/templating/templates-and-document-types/39251-Surfacecontroller-and-ajax-request-to-action

    Dave

  • Akeem 43 posts 198 karma points
    Apr 11, 2016 @ 17:27
    Akeem
    0

    Hi Dave,

    While on the English Site , is it possible to get the Value of DictionaryItem in French Version ?

    enter image description here

  • athul 26 posts 117 karma points
    May 11, 2017 @ 06:44
    athul
    0

    Hi, Dave I encountered same issue and

    Umbraco.GetDictionaryValue("messagekey")
    

    is also not working for me. GetDictionaryValue as well asumbraco.library.GetDictionaryItem returns only empty string for me in my ajax action method. Can you please specify, Is there any other change I need to make to this thing work? Note: System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo(Request.Form["culture"]); will throw a null reference exception for me.

  • Leena 29 posts 100 karma points
    Apr 03, 2013 @ 11:54
    Leena
    1

    thanks Dave :) its working now

  • Sean Håkansson 66 posts 192 karma points
    May 23, 2016 @ 08:50
    Sean HÃ¥kansson
    3

    If anyone was struggling with @Umbraco.GetDictionaryValue, I had to set CurrentUICulture culture to make it work.

    System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo(Request.Form["culture"]);
    
Please Sign in or register to post replies

Write your reply to:

Draft