Question : How do I add an ASP value to a Javascript?

I have a Javascript that I am trying to add an ASP value (<%=Session("FullName")%>) to.

Everything I've tried has returned a syntax error.

For example:

pReport = "<p><B>Report Name :</B>"+title+"<br><B>Date :</B> "+tarih.format("m/d/Y H:i:s")+"<br><B>User :</B><%=Session("FullName")%></p><br><br>";

1:
pReport = "<p><B>Report Name :</B>"+title+"<br><B>Date :</B> "+tarih.format("m/d/Y H:i:s")+"<br><B>User :</B>"+adi+"</p><br><br>";

Answer : How do I add an ASP value to a Javascript?

If the code is in a .JS file it won't work as the JS file is not considered an Active Server Page, therefore any ASP commands will not be run.

A workaround might be to call the JS file pass the values on a querystring - then use javascript to get the querystring value.
Random Solutions  
 
programming4us programming4us