Avatar of Member_2_6492660_1
Member_2_6492660_1Flag for United States of America

asked on 

ASP code HREF help needed

Windows 2012 R2 Web Server
IIS 8.5

Just moved my sites from a Windows 2003 with IIS 6 web server
Also moved many pages from wwwroot to wwwroot\folder2

one of the pages in wwwroot\folder2 calls a page that is still in wwwroot
when I click on the link I get 404 - File or directory not found.

this is my code

<form>
    <input type="button" value="Sign Our Guest Book" onClick="window.location.href='GuestBook.htm'">
  </form>

I tried this by adding ~/  which places you back to the root but since the site is in folder2 I am thinking the folder2 is the root for that site

<form> 
    <input type="button" value="Sign Our Guest Book" onClick="window.location.href='~/GuestBook.htm'">
  </form> 

Open in new window



c:\inetpub\wwwroot\guestbook.htm
c:\inetpub\wwwroot\folder2\test.asp



how do I get test.asp to call guestbook.htm using the onclick href?


Thanks

Tom
Web DevelopmentASPWeb Servers

Avatar of undefined
Last Comment
Member_2_6492660_1
Avatar of Big Monty
Big Monty
Flag of United States of America image

remove the tilda:

<form> 
    <input type="button" value="Sign Our Guest Book" onClick="window.location.href='/GuestBook.htm'">
  </form> 

Open in new window

Avatar of Member_2_6492660_1

ASKER

Big Monty

Thanks

Same results.

The url comes up like this http://www.tomsmp3.com/GuestBook.htm

And guestbook.htm is not in that folder


check it out www.tomsmp3.com

select guestbook at bottom of page your will see
Avatar of Big Monty
Big Monty
Flag of United States of America image

my apologies, i mis-understood your question, i thought guestbook was at the root

whats the folder name for the guestbook.asp page?
Avatar of Member_2_6492660_1

ASKER

Big Monty no worries

here is my folder structure

c:\inetpub\wwwroot
three files reside in this folder
guestbook.asp
guestbook.htm
guestbook2.asp

guestbook.htm is what is called by the onclick  href

now in
c:\inetpub\wwwroot\music  
music.asp


has
<form>
    <input type="button" value="Sign Our Guest Book" onClick="window.location.href='/GuestBook.htm'">
  </form>
ASKER CERTIFIED SOLUTION
Avatar of Big Monty
Big Monty
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
here is my folder structure
To clarify - http://www.tomsmp3.com/guestbook.htm - does not load the page guestbook.htm - if entered into a browser?
Avatar of Member_2_6492660_1

ASKER

If I copy the files into the music folder then I will have two copies of the same code.

In wwwroot is my main site home pages which call the same guestbook.htm  code.

any other ideas?

ps /../ same results
SOLUTION
Avatar of Wayne Barron
Wayne Barron
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Member_2_6492660_1

ASKER

Thanks every one for your help

I moved them to a new folder under the music folder

I like keeping code organized makes things easier to find when trouble shooting

Thanks again
ASP
ASP

Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.

82K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo