Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 707 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ASP.NET MVC Page Won't Load and says "The resource cannot be found"

#1
I am having a problem where I try to open my ASP.NET MVC application but I get the ASP.NET error page which says 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: /EventScheduler/account.aspx/login
>
>Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053**

I am using the URL trick from this blog post and that is why I have the .aspx in the URL:

[To see links please register here]


It works on my other sandbox server (not a dev machine), and now I just deployed it to my production site as a new virtual directory, but for some reason it seems like it's actually looking for a .aspx file.

Any ideas? I think I must be forgetting a step.
Reply

#2
Make sure you're not telling IIS to check and see if a file exists before serving it up. This one has bitten me a couple times. Do the following:

Open IIS manager. Right click on your MVC website and click properties. Open the Virtual Directory tab. Click the Configuration... button. Under Wildcard application maps, make sure you have a mapping to `c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll`. MAKE SURE "Verify the file exists" IS NOT CHECKED!

Reply

#3
If you're running IIS 6 and above, make sure the application pool your MVC app. is using is set to **Integrated** Managed Pipeline Mode. I had mine set to Classic by mistake and the same error occurred.
Reply

#4
Had the same issue, in my case the cause was that the web.config file was missing in the virtual dir folder.
Reply

#5
Suppose source code copy from other places.

Sometime, if you use Virtual Directory in your application url like:

[To see links please register here]


No route will pick up the request.

solution:

Explicitly click the button 'create a virtual directory' in your project file.
Reply

#6
I got the same error while building a MVC application.
In my case it happened because I forgot to add the string "Controller" in my controller name.

### Error With

public class ProductType : BaseController
{
public ProductType()
{
}
}

### Resolved

public class ProductTypeController : BaseController
{
public ProductTypeController ()
{
}
}


Reply

#7
In your Project open Global.asax.cs then right click on Method RouteConfig.RegisterRoutes(RouteTable.Routes); then click Go To Definition
then at `defaults: new { controller = "Home", action = "Index", id =UrlParameter.Optional}`
then change then Names of "Home" to your own controller Name and Index to your own View Name if you have changed the Names other then "HomeController" and "Index"
Hope your Problem will be Solved.
Reply

#8
I had the same problem caused by my script below. The problem was caused by url variable. When I added http://|web server name|/|application name| in front of /Reports/ReportPage.aspx ... it started to work.
<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->

<script>
$(document).ready(function () {
DisplayReport();
});

function DisplayReport() {
var url = '/Reports/ReportPage.aspx?ReportName=AssignmentReport';

if (url === '')
return;
var myFrame = document.getElementById('frmReportViewer');
if (myFrame !== null) {
if (myFrame.contentWindow !== null && myFrame.contentWindow.location !== null) {
myFrame.contentWindow.location = url;
}
else {
myFrame.setAttribute('src', url);
}
}
}
</script>

<!-- end snippet -->

Reply

#9
<br>Step 1 : Check to see if you have received the following update?

[To see links please register here]

If you have you might want to follow this procedure and see if it works for you. It worked partially for me.
The item where it mentions the additional "/" to be removed is not entirely true but it did give me some insight to change my project properties just a bit.<br><br>
step 2 : Right click on your properties for your Web Project in your Solun.
Select WEB > Choose Current Page instead of Specific Page.<br><br>
step 3 : Go into your project where you keep your *.aspx's select a start page. (Should be the same as the current page or choose another one of your choice :) )
Hit Debug Run.
Reply

#10
The page is not found cause the associated controller doesn't exit. Just create the specific Controller. If you try to show the home page, and use Visual Studio 2015, follow this steps:

1. Right click on Controller folder, and then select Add > Controller;
2. Select MVC 5 Controller - Empty;
3. Click in Add;
4. Put HomeController for the controller name;
5. Build the project and after Run your project again

I hope this help
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through