Solved

ASP .Net MVC: The resource cannot be found.

Posted on 2011-02-22
4
1,777 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
  • 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

759 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

18 Experts available now in Live!

Get 1:1 Help Now