English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have an Access DB that has picture names stored in it that I can read using ADO. e.g. photo1, photo2 etc.
I have a picture viewer supplied by Dynamic Drive that is written in Javascript.
I want to be able to pass the names i have from <%ado variables%> to the javascript

Any ideas?

Novice Web programmer - SongSearcher :)

2007-03-23 05:29:59 · 2 answers · asked by song searcher 1 in Computers & Internet Programming & Design

2 answers

Your use of ADO is somewhat improper here... you are using ASP to write the server-side script; ADO is simply one aspect of ASP, specifically that relating to database interoperability.

Keep in mind that ASP script (inside the <% %>) is processed on the server, before it is sent to the client browser. JavaScript, on the other hand, is sent to the client browser as plain text and interpreted there. So, the two cannot communicate directly.

In order to set JavaScript variables via ASP, you need to write JavaScript using ASP. A very simple example would be:



The server will process your server-side commands, including the one to write out "variable" in that location, so the end result will be the page as sent to the browser:

2007-03-23 06:21:43 · answer #1 · answered by Rex M 6 · 0 1

Here's a possibility: The label (lblEmail) is set up as a hyperlink with the Email Address taken from a database.

The javascript takes the email address (recipient) from the link and opens an Email window to send to that address.

Maybe you can adapt that to your needs.

lblEmail.Text =
""