I work on a multilingual C # website. I wrote databaselanguages โโclass files and languages. In this class, I put all the lines in the appropriate language. By default, this language is Dutch if no cookie exists. Before I used the language class, I wrote it by default aspx.cs and requested a cookie as follows:
Context.Request.Cookies ["lancookie"];
If the language was changed, I changed the cookie and reloaded the page. In the language class, I use:
HttpContext.Current.Request.Cookies ["lancookie"].Value;
If I change the language, it will take several minutes before it also just boots up. What can I do to trigger a cookie?
public class Language { public static string getLanCookie () { lancookie string = string.Empty; if (HttpContext.Current.Request.Cookies ["lancookie"]. Value! = null) { lancookie HttpContext.Current.Request.Cookies = ["lancookie"]. Value; } else { lancookie = "Dutch"; } lancookie return; } public static string language = getLanCookie () public static string Home = Language ("Home", language); public static string end = Language ("The End", language); public static string Subject = Language ("Box", language); }
source share