Thomas
Thomas

Reputation: 297

Server Error in '/' Application. The resource cannot be found. (ASP.NET mvc 2 + built in web server)

I'm trying to make a MVC 2 web application for a small portal. I started with the template in VS 2010 and made several other .aspx pages (for views) Index.aspx (was a part of the template) opens like he should open, but when I click on a link to acces another aspx page (that I added to the template) he show me this:

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/AccountPages/Aanvragen.aspx

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

When I set Aanvragen.aspx as startup page, he show me the same message. I use a built in server (VS2010). Of course, I checked if the url is correct and it is. So that is certaintly not the problem

Anyone that could help me ?

Thanks a lot

Upvotes: 0

Views: 6113

Answers (1)

Andrew Barber
Andrew Barber

Reputation: 40160

You should not be requesting view pages directly at all; the web.config that comes with ASP.NET MVC blocks direct requests for all views in the /views directory, for one thing.

You can link to regular web forms pages elsewhere in your site, such as in the root directory, but that's really not how MVC is meant to be used. You may want to seek out a tutorial on ASP.NET MVC, as it seems you aren't familiar with how to use it. Check out the http://www.asp.net/mvc web site.

Upvotes: 1

Related Questions