User-780288965 posted
Hi,
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.
Works Fine:
String csName = "ButtonClickScript";
Type csType = this.GetType();
ClientScriptManager cs = Page.ClientScript;
if (!cs.IsClientScriptBlockRegistered(csType, csName))
{
cs.RegisterStartupScript(csType, csName, "<script language='javascript'>alert('No results Returned');</script>");
But this does not work:
cs.RegisterStartupScript(csType, csName, "<script language='javascript'>alert('<%=GetGlobalResourceObject(/"ResxfileName/",/"KeyName/") %>');</script>");
I also tried assiging the value to a string and then tried to access it but it did not work.
Could someone help please.
Thanks,
Sathish