Link to home
Start Free TrialLog in
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
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
my apologies, i mis-understood your question, i thought guestbook was at the root

whats the folder name for the guestbook.asp page?
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

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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?
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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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