Question : trouble moving a session variable into javascript

I have the following code that doesn't seem to work in JS  -

var mytest = "<% =session('pnConnectorType') %>";
document.frmPartNumber.pnConnectorType.value = mytest;

When I do something like this:

var mytest = "TEST";
document.frmPartNumber.pnConnectorType.value = mytest;

It works fine - I really need to move an ASP session variable into that javascript variable but it isn't working - can someone help explain why?

Thanks!

Answer : trouble moving a session variable into javascript

an external js file is not going to run any ASP commands.  Again, you would need to define it as I stated above.

Random Solutions  
 
programming4us programming4us