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
LVL 23
Thomas GrassiSystems AdministratorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
remove the tilda:

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

Open in new window

0
Thomas GrassiSystems AdministratorAuthor Commented:
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
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
my apologies, i mis-understood your question, i thought guestbook was at the root

whats the folder name for the guestbook.asp page?
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Thomas GrassiSystems AdministratorAuthor Commented:
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>
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
it would be easier if you could move the file(s) to your music folder, which is now your root folder (if I understand correctly). otherwise, you may need to make wwwroot a virtual folder (which I've never heard being done before) or the following code may work (but I doubt it)

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Julian HansenCommented:
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?
0
Thomas GrassiSystems AdministratorAuthor Commented:
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
0
Wayne BarronAuthor, Web DeveloperCommented:
Inside of the music folder.
Create a folder called: Guest
Inside of that folder. move all the files over that go with the Guestbook pages.
Now, you just reference them like you supposed to.

you stated that you would have 2 copies, if you moved them over there.
In that case, why don't you simply just use the existing pages that are already in the music folder?

Need some more information on what exactly you are trying to achieve.
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Your home page links to http://www.tomsmp3.com/GB/GuestBook.htm

What is the purpose of mixing up .htm and .asp files and different folders?  It's best to keep either all .asp or .htm/.html.
0
Thomas GrassiSystems AdministratorAuthor Commented:
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
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.