Problem picking up file key . resx

Asked

Viewed 84 times

0

I have a NullReferenceException in this line:

string from = HttpContext.GetGlobalResourceObject("globalization", "mail_from").ToString();

because it is not finding the file . resx, so it does not find the "mail_from" and gives ToString() null.

I have the file in the folder App_globalresources, called globalization.en.resx.

  • Use Resources.globalization.ResourceManager.GetString("mail_from") works?

  • @jbueno It worked, took advantage and created a separate class to handle and facilitate the string search, thank you very much :). If you want to make an answer I can put as answered..

  • Not at all, I added the answer.

1 answer

2


I don’t know why this doesn’t work, but you can try it in the standard way

Resources.globalization.ResourceManager.GetString("mail_from‌​")

Browser other questions tagged

You are not signed in. Login or sign up in order to post.