Solved

HTTP Error 404.0 - Not Found

Posted on 2013-05-23
5
459 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
  • 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 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