mercredi 29 avril 2015

Could not find any resources appropriate for the specified culture or the neutral culture.(MULTILINGUAL)

protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Lang"] == null) { 
                Session["Lang"] = Request.UserLanguages[0];
            }

            if (!IsPostBack)
            {
                LoadString();

            }

        }

protected void ddLang_SelectedIndexChanged(object sender, EventArgs e)
        {
            Session["Lang"] = ddLang.SelectedValue;
            LoadString();
        }

private void LoadString(){
            Thread.CurrentThread.CurrentCulture = new CultureInfo(Session["Lang"].ToString());
            rm = new ResourceManager("ASPMultilingual.App_GlobalResources.Lang", Assembly.GetExecutingAssembly());
            ci = Thread.CurrentThread.CurrentCulture;


            btnLogIn.Text = rm.GetString("Login", ci);
        }

here is my code and the resource file i store at App_GlocalResources as Lang.ch-CH.resx, Lang.en.EN.resx and Lang.de.DE.resx.

after I compile it throw me this error and point to "btnLogIn.Text = rm.GetString("Login", ci);".

inside my resource has the name of Login. Anyone can help?




Aucun commentaire:

Enregistrer un commentaire