Basic Java / ASP Question

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
dmcquade
Advanced
Advanced
Posts: 15
Joined: Fri Oct 27, 2006 6:26 pm

Basic Java / ASP Question

Post by dmcquade »

Hey everyone,

I have an ASP page that has a number of Milonic menus on it. For each menu I need to send one or more variables to my menu_data.js (now menu_data.asp) page. Does anyone know how this can be done? It seems like it reads the file once at the beginning so my variables aren't going through.

Here's another way to think about this. Lets say I have a list of records with database ID's 1,2,3. I need to create a new menu for each record that has a link to display_record.asp?record_id=1 and so on.

Anyone try this?

DJ
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi DJ,

You've probably seen my other post by now. Don't know if it helped.

Your asp code is only processed on the server side. Once the code hits the client (browser), your variables are no longer variables; no longer available to asp processing.

It sound to me like you're doing your database query in one file, and building the menu in another (menu_data.asp). Instead, try doing all of it in one file... query the database, loop through the record set, and build the menu, all in menu_data.asp.

Alternatively, put the menu definitions in as inline javascript (you could even do it in an include file), so that, again, you're looping through the recordset and building the menu in the same asp file.

Hope that helps,

Kevin
Post Reply