Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ASP.NET Href not going to subfolders

Posted on 2007-10-13
3
Medium Priority
?
1,111 Views
Last Modified: 2013-11-26
I am working on a web site using a master page using Visual Web Studio 2008. I have the project in a folder MyDocuments/visual studio 2008/master page/. I have put diferent sections of the site in different folders. you can see the different folders I am using in the solution explorer. I have two problems.

The first one is that when I do an Href and select the link from the list of files in the project and when I run the project the links dont work properly. I get a page not found. I have tried these 3 combinations  "forums/default.asp", "/forums/default.asp" and "~/forums/default.asp". None of them seem to work.

Secondly, when I try to include an image in one of the pages I want to put the images in the images folder but I get broken images. I have a feeling the solution to my above problem will also solve this problem.

The solution I would like to find is the one that will allow me to upload the site from my system and have everything work fine. I have tried Running IIS for my project but I get a configuration error os some sort. All I have done to set up IIS is point to the home directory of my project. This has worked in the past for me with regular ASP. Is there a guide somewhere to configuring IIS to run an ASP.NET project?
0
Comment
Question by:dmat1
2 Comments
 
LVL 16

Accepted Solution

by:
gnoon earned 2000 total points
ID: 20070578
To solve this problem, you may take one of the following approaches:

* Use absolute URL paths in the Master Page, for example <img src="/myapplication/images/banner.gif" />
* Use relative or application-relative URLs in server controls instead of static markup, for example <asp:Image ImageUrl="~/images/banner.gif" runat="server" />

Also, check what link generated in the browser after project run.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 21022593
Forced accept.

Computer101
EE Admin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question