lundi 10 décembre 2018

How to use server tag inside alert()?

Perhaps this is a stupid thing to ask but the already available solutions didn't seem to work for me.

I have a Resources.resx file and I am trying to use this inside an alert()

Here's what I did.

if(obj)
{
   myMethod();
}
else
{
   alert(<%= Resources.Nill %>);
}

I also tried to use quotes like alert("<%= Resources.Nill %>"); (both single and double) but then the output generated is <%= Resources.Nill %> on the screen.

I want the value the Resource holds to be showed when else is executed. What am I doing wrong?

Aucun commentaire:

Enregistrer un commentaire