-
Hi guys,
In my [main.asp] file at some point I have the following code:
<script language='JavaScript'>
NickName=document.Info.NickName;
Application('Nick Name')=NickName <<------ doesn't work?
.
.
.
My problem is that I can't assign the value an ASP variable (server variable) to a script variable, my question how can solve this?
Waiting for your appreciated answers,
poor Wesam!
-
Remember ASP gets parsed before javascript. So when you assign the application asp variable a client side javascript value it will always be blank if they both reside in the same physical file.
-
If you are generating the server-side variable and need to just pass it into the page so it is available on the client side, just create the Javascript code using response.write statements.
If you are trying to do the opposite, and assign something from the client side into a server-side variable, you will most likely need to either refresh the page using querystrings or use a form and submit the form to the same page and put server side code to handle if the page has been submitted.
Hope that helps and.. well.. makes sense..
/\/\onte96
-
Thank you, I solved the problem.