Solved

HTTP Error 404.0 - Not Found

Posted on 2013-05-23
5
467 Views
Last Modified: 2013-05-28
I built web sites using VS 2008 and VS 2010.  VS 2012 is different.
I started a new website named StockProNew.  An About page was automatically created.
The app compiled and ran.

Then I renamed About.aspx to AboutUs.aspx and viewed it in the browser. The page displayed properly.  The app compiled and ran until I clicked on the link to the AboutUs page.

<ul>
            <li><a runat="server" href="~/">Home</a></li>
            <li><a runat="server" href="~/AboutUs">AboutUs</a></li>
            <li><a runat="server" href="~/Contact">Contact</a></li>
        </ul>

Error:
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

Most likely causes:
•The directory or file specified does not exist on the Web server.


Module
   IIS Web Core

Notification
   MapRequestHandler

Handler
   StaticFile

Error Code
   0x80070002


Requested URL
   http://localhost:56720/About

Physical Path
   c:\users\dovberman\documents\visual studio 2012\Projects\StockProNew\StockProNew\About

AboutUs.aspx does exist as expected. About.aspx does not exist as expected.

Why is the app still looking for About.aspx?

http://localhost:56720/AboutUs.aspx displays the page.

How can I fix this?
0
Comment
Question by:Dovberman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 29

Expert Comment

by:Kumaraswamy R
ID: 39190474
<li><a runat="server" href="~/About/AboutUs">AboutUs</a></li>
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39190553
What kind of project did you select when you first created the solution?
0
 

Accepted Solution

by:
Dovberman earned 0 total points
ID: 39190829
A website project was selected.

Cannot simply modify a page that was automatically created. These pages are not recognized by the site master.

I imagine the development structure has been changed to support conversion to run on mobile devices.

Solution:

1. Add a new web form as follows:

  Right click the project name. Select "Add". Then Select "Add Form using Master Page.

Name the new page. ie. AboutUs1.aspx

2. Edit the new web form:

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master"
    AutoEventWireup="true" CodeBehind="AboutUs1.aspx.cs" Inherits="StockProNew.AboutUs1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
       <ul>
            <li><a id="A1" runat="server" href="~/">Home</a></li>
            <li><a id="A2" runat="server" href="~/AboutUs1">AboutUs1</a></li>
            <li><a id="A3" runat="server" href="~/Contact">Contact</a></li>
        </ul>
</asp:Content>

The new page is recognized by the site master.
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39191085
Cannot simply modify a page that was automatically created.
Sure you can.

Screenshot
I don't understand why your hrefs don't have the ".aspx" extension. Did you enable URL rewriting?
0
 

Author Closing Comment

by:Dovberman
ID: 39200633
My solution worked.
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

696 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