Solved

HTTP Error 404.0 - Not Found

Posted on 2013-05-23
5
456 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
Comment Utility
<li><a runat="server" href="~/About/AboutUs">AboutUs</a></li>
0
 
LVL 74

Expert Comment

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

Accepted Solution

by:
Dovberman earned 0 total points
Comment Utility
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 74

Expert Comment

by:käµfm³d 👽
Comment Utility
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
Comment Utility
My solution worked.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now