Solved

ASP .Net MVC: The resource cannot be found.

Posted on 2011-02-22
4
1,878 Views
Last Modified: 2013-12-17
I have my Index.aspx set in the correct location but I am receiving the following error after I clicked in Set as Start Page:

Server Error in '/' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /Views/Home/Index.aspx
0
Comment
Question by:DistillingExperts
[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
4 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 34953616
If it is an MVC app then setting a start page won't work. The files with .ASPX extension aren't physical pages they are Views invoked by your controller. You don't navigate to pages, you invoke actions on controllers to get around.
0
 
LVL 2

Expert Comment

by:Aazmodeus
ID: 34954071
try:
<sitedomain>/Home/Index
or even simply:
<sitedomain>

MVC uses routing to bind aspx pages (views) to virtual urls.
If you open global.asax, you'll see routes added to routes dictionary on application start. There should be a default rule and you can add as many rules as you want.
Each route added to the table has 3 parameters:
 - Route name: can be any string, e.g. "a route to a view that display items in categories"
 - Route pattern: formatted string describing route pattern.
E.g. "{controller}/{action}/{category}/{id}". Here controller and action are reserved for controllers and their public methods, the rest must match the method parameter names.
 - Object with pattern default values: this one must have a field for each piece of pattern in {} brackets. Considering the pattern above that would be for example:
new {controller = "Catalog", action="Show", category="Kitties", id=3 }

Now this route says that  the application should try to find controller named "{controller}", which has a public method named "{action}" and this method must take two arguments named "category" and "id". If application doesn't find any matching controller or method it goes to the next route and tries to parse the url accorfing to it.

You can define different patterns, even without names of controllers, methods, paramters, etc.
For example:
"Dat route",
"/WhosYourDaddy",
new {controller="Data", action="Remove", id="root"}
Now visiting link "<sitedomain>/WhosYourDaddy" will end up in calling
new DataController().Romove("root");
0
 

Author Comment

by:DistillingExperts
ID: 34958847
Sorry, but I didn't understand what I have to do to effectively fix my problem.
0
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 34958884
Open your project properties page, go to the "Web" tab and remove the text from the "Specific Page" field.
0

Featured Post

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

691 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