Solved

Assigning a variable for the web application's path

Posted on 2002-06-13
5
140 Views
Last Modified: 2010-04-09
How can I declare a path statement whereas  in my HTML I can just call the variable name instead of the path?  I have seen code like <a href = <%userpath%> & "whatever.htm"...... but don't know how to use it. I want to use it in multiple pages mainly so I do not have to keep changing my hardcoded paths in all my pages whenever I move something.
I am using Javascript in my pages too.
0
Comment
Question by:CCOIA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 10

Expert Comment

by:KenAdney
ID: 7075998
Well, I think you've got most of it, the part about  referring to the previously defined variable.  I think all you have to do is define what "userpath" is, for instance:

<%userpath = "../file_directory/" %>

put somewhere in the head of the ASP page.
0
 

Author Comment

by:CCOIA
ID: 7076175
That is my problem (should have elaborated more).  It is not an ASP page.  It is on a page that will be on an AS400 server running Webshere.  Can I still use the above syntax in a non-ASP page?
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 50 total points
ID: 7076222
That is strictly ASP syntax.  You can do it ins straight HTML by putting this in the head of the pages.

<base href="http://www.mysite.com/myfolder/index.html">
It will then treat everything up to the file name as the base path.  so a reference in the page like:

<a href="thepage.htm">  We be interrpreted as <a href="http://www.mysite.com/myfolder/thepage.htm">

and  <img src="images/my.gif"  will be >img src="http://www.mysite.com/myfolder/images/my.gif">

Cd&
0
 

Author Comment

by:CCOIA
ID: 7076250
Thanks, just what I was looking for.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7076468
Glad we could help.  Thanks for the A. :^)

Cd&
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
IF statment In Powershell 12 28
Clear input text 15 26
Date on a table 16 33
Validating Date 4 28
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question