Copied to clipboard

Flag this post as spam?

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


  • Hardy Wang 91 posts 112 karma points
    Mar 16, 2012 @ 15:39
    Hardy Wang
    0

    Error happened while GetDictionaryItem() is called

    I created 2 languages for my site English and French, I also created dictionary items named "Login_Username" and "Login_Password".

    I created a user control, in the code behind I have

            protected void Page_Load(object sender, EventArgs e)
            {
                if (!this.IsPostBack)
                {
                    this.lbUsername.Text = library.GetDictionaryItem("Login_Username");
                    this.lbPassword.Text = library.GetDictionaryItem("Login_Password");
                }
            }

    I created macro by using this ASCX control and inserted it into one of my node.

    I navigated to http://localhost:8901/authentication/login.aspx?umbdebugshowtrace=true which is a content node with user control macro embedded, at the bottom of trace data I saw 

    library Error returning dictionary item 'Login_Username'
    Object reference not set to an instance of an object.
      at umbraco.library.GetDictionaryItem(String Key)  

    library Error returning dictionary item 'Login_Password'
    Object reference not set to an instance of an object.
      at umbraco.library.GetDictionaryItem(String Key)

    What is wrong here?

  • Rodion Novoselov 694 posts 859 karma points
    Mar 16, 2012 @ 16:05
    Rodion Novoselov
    0

    Hi. Have you associated hostname/language pairs for those languages with your site?

Please Sign in or register to post replies

Write your reply to:

Draft