C#Novice 0 Newbie Poster

Hi All,
I m working on a project that has different sub-projects. I would like to include a link to a file that is placed in another folder. For ex. My file whose path is ProjB/FolderB/FileB.asp --I want to write a line of code that will enable me to link to a file whose path is ProjA/FolderA/FileA.asp.
Can I achieve this using the navigateURL command?How?
Thanks in advance.

Dani AI

Generated

— a short clarification and practical options. The NavigateUrl property belongs to ASP.NET controls (HyperLink, etc.) and is not part of classic ASP. In classic ASP you create a normal HTML link or perform a server-side redirect/execute. Below are concise, working approaches.

Use a plain HTML link (absolute-virtual, relative, or full URL):

<a href="/ProjA/FolderA/FileA.asp">Open FileA</a>
<a href="../../ProjA/FolderA/FileA.asp">Open FileA</a>
<a href="http://yourdomain/ProjA/FolderA/FileA.asp">Open FileA</a>

Programmatic server-side options in classic ASP:

<%
Response.Redirect "/ProjA/FolderA/FileA.asp"
%>
<%
Server.Execute "/ProjA/FolderA/FileA.asp"
%>

Notes and cautions:

  • Use Response.Redirect to send the client to the other page (browser URL changes). Use Server.Execute when you want the server to run the other page and return its output into the current response (browser URL stays the same).
  • A leading slash (/ProjA/...) is from the web site root. Count path segments when using .. (each .. moves one directory up).
  • Server-side includes are another option for sharing code: <!--#include virtual="/ProjA/FolderA/include.inc" --> (preprocessed on the server).
  • Server.MapPath("/ProjA/FolderA/FileA.asp") returns the physical path when you need file-system access.
  • If ProjA is a separate site/host or requires auth, use the full URL or reconfigure IIS; you cannot "include" server-side code from a different domain.

Choose the method that matches whether you need a client navigation, a server-side include, or to execute another ASP page on the server.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.