I have a hardcoded JavaScript value in my aspx page that is currently functioning.
PersonalReportLink.innerHTML = '<%=(String)HttpContext.GetGlobalResourceObject(@"languagetext","PersonalReportFrench")%>';
Now I want to make it dynamic. Here is what I am attempting:
sel_lang = "French" //this is the value obtained from the user PerReportStr = '<%= (String)HttpContext.GetGlobalResourceObject(@"languagetext","PersonalReport'+ sel_lang + '") %>';
This code gives me an empty string after execution, i.e., PerReportStr="" I believe the correct keyword is not being passed to the resource file.
The reason for this issue is that I am unable to construct the below string correctly using C#.
(String)HttpContext.GetGlobalResourceObject(@"languagetext","PersonalReportFrench")
Can someone please assist me in creating the above string using C#?