Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking to other ASP pages

Status
Not open for further replies.

ferryjenny

Technical User
Nov 22, 2000
24
0
0
GB
Hi

I am new to ASP and need some help. I have an ASP page which displays information from a database, this page also contains hyperlinks to other pages. These other pages are also ASP pages. When I select the link the page opens but none of the VBScript inside the pages run.

Somebody told me you cant link to other ASP pages using normal hyperlinks and have to use something called redirect instead. Can somebody please tell me how to create a hyperlink from one ASP page to another.

Many Thanks
 
that is rediculous that they told you, you can't link to a .asp page. it is like any other web page and if you create a link to it the browser will go to it. show your code. Maybe there is something else that is wrong or possibly be more specific on how you're linking to the pages Was it something I said?
admin@onpntwebdesigns.com
 
I am still confused I have a page which we will call page 1 which links to a database and works fine on this page is the following link.

<a href=&quot;C:\Inetpub\ Page.asp&quot; title=new page>

This link is to a new page which should also connect to a database. Page one works fine when the link above is chosen page 2 opens and is displayed however none of the data from the database is displayed. Its like none of the code between the <% %> tags is running.

If you open page 2 dircetly then it works it just dosent work if you use the hyperlink to go there
 
I am still confused I have a page which we will call page 1 which links to a database and works fine on this page is the following link.

<a href=&quot;C:\Inetpub\ Page.asp&quot; title=new page>

This link is to a new page which should also connect to a database. Page one works fine when the link above is chosen page 2 opens and is displayed however none of the data from the database is displayed. Its like none of the code between the <% %> tags is running.

If you open page 2 dircetly then it works it just dosent work if you use the hyperlink to go there
 
Sounds like there's a problem in your DB connection someone and not the link. The link should not mean anything but simply a link. the page loads and the server/browser does its thing. IF you open the page in question seperatly does the data populate correctly? Are you linking on a event such as if the user does a certain action as clicking something? If that is the case you may want to try <% server.execute &quot;page.asp&quot; %>

can you post the code for the page possibly Was it something I said?
admin@onpntwebdesigns.com
 
Aha!! there is your problem.. In order to have the ASP pages executed.. you MUST call it through the IIS or PWS web server.. You can't just link to it through your regular harddrive (filesystem).

Instead of:

<a href=&quot;C:\Inetpub\ Page.asp&quot; title=new page>

Try:

<a href=&quot; Page.asp&quot;>

Hope this helps,

Gorkem.
 
Addendum...

Refine your link to:

<a href=&quot;/catex/new page.asp&quot;>

This is so you can upload your pages to another server and still have them work!

Sorry about the confusion.. early morning! heh

Cheers,

Gorkem.
 
I can't believe I didn't notice the path that was used.
good catch Gorkem Was it something I said?
admin@onpntwebdesigns.com
 
Thank you both so much The pages work fine now and I am very grateful for all your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top