Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:49
Server Variables
Poster: taylorpd
Dated: Monday November 6 2006 - 8:28:05 GMT
I am trying to collect some server variables in order to personalise / manage selections in the menu URLs.
I have sorted the URL aspect but cannot get the server request code to work in the menu file i.e. like this example:
Code:
function getSessionURL()
{
var SessionURL = Server.HTMLEncode(Request.ServerVariables("AUTH_USER"));
return SessionURL;
}
I'm sure its something simple but as a beginner, any help would be appreciated.
Poster: kevin3442
Dated: Monday November 13 2006 - 23:31:39 GMT
How do you want to incoporate the return of getSessionURL into the menu, as part of a menu item's url property? Help me to understand that, and I'll try yo show you how.
Cheers,
Kevin
Poster: taylorpd
Dated: Tuesday November 14 2006 - 5:48:08 GMT
To employ as a URL variable for individualisation is exactly how I would like to employ these server variables.
Thanks
paul
Poster: kevin3442
Dated: Wednesday November 15 2006 - 4:27:46 GMT
Hi Paul
Still not 100% sure where you want this in the menu code, but I'll take a stab. I'm assuming from your code snippet that you're using javascript as your ASP scripting language, rather than VBScript.
First, is your js code inline, in the main ASP file, or are you loading the menu's js code from an external file? If you're loading it from a separate file, remember to use .asp as the filename extension (e.g., menu_data.asp rather than menu_data.js), otherwise, the asp statements in the file won't be processed when the file is served... they'll be interpreted by the browser as js code and cause an error.
So:
to use the return of getSessionURL() in the url property of a a menu item definition:
Code:
aI("text=Item Text; url=<%=getSessionURL()%>;");
Hope that helps,
Kevin
Poster: taylorpd
Dated: Thursday November 16 2006 - 7:25:31 GMT
Kevin
Thanks for you patience!
I started by downloading the frames sample and customising to suit hence the code I am trying to get to work is in the menu_data_body.js file which is loaded by the body asp file.
On other asp pages, I have code working that collects and displays various Server.HTMLEncode variables.
Also I found other downloads that work in the menu body file and allow a varibale to be used in the actaul menu items but I just cannot get these server variables to work.
It was my intention to keep the code in the js files rather than filling out each individual asp file that might get loaded into the body frame.
I tried yor suggestion of building it into the asp file but to no avail.