Last post Nov 23, 2011 10:04 AM by sathish57
Nov 22, 2011 11:42 AM|sathish57|LINK
I am trying to show a pop up message using java script from code behind. It works fine when the alert message is included in the code. But not able to access the value from the resource file. The above works fine but when I try to access the resorce file
key in the alert message, it does not work.
String csName = "ButtonClickScript";
Type csType = this.GetType();
ClientScriptManager cs = Page.ClientScript;
if (!cs.IsClientScriptBlockRegistered(csType, csName))
But this does not work:
I also tried assiging the value to a string and then tried to access it but it did not work.
Could someone help please.
Nov 22, 2011 04:08 PM|Erwin21|LINK
Have you tried something like this?
string message = GetGlobalResourceObject("ResxfileName","KeyName");
cs.RegisterStartupScript(csType, csName, script);
Or you can look at the Localizing Resources for Component Libraries http://msdn.microsoft.com/en-us/library/bb398937.aspx
Nov 23, 2011 10:04 AM|sathish57|LINK
Thanks Erwin, it worked :)