0Day Forums
ASP.NET MVC Page Won't Load and says "The resource cannot be found" - Printable Version

+- 0Day Forums (https://0day.red)
+-- Forum: Coding (https://0day.red/Forum-Coding)
+--- Forum: Asp.Net (https://0day.red/Forum-Asp-Net)
+--- Thread: ASP.NET MVC Page Won't Load and says "The resource cannot be found" (/Thread-ASP-NET-MVC-Page-Won-39-t-Load-and-says-quot-The-resource-cannot-be-found-quot)

Pages: 1 2 3


ASP.NET MVC Page Won't Load and says "The resource cannot be found" - donnishly863564 - 07-23-2023

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.


RE: ASP.NET MVC Page Won't Load and says "The resource cannot be found" - melbaxrkdxx - 07-23-2023

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!




RE: ASP.NET MVC Page Won't Load and says "The resource cannot be found" - petrifaction651 - 07-23-2023

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.


RE: ASP.NET MVC Page Won't Load and says "The resource cannot be found" - sailplanes54809 - 07-23-2023

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


RE: ASP.NET MVC Page Won't Load and says "The resource cannot be found" - olivary358026 - 07-23-2023

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.


RE: ASP.NET MVC Page Won't Load and says "The resource cannot be found" - Drgalina7 - 07-23-2023

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 ()
{
}
}





RE: ASP.NET MVC Page Won't Load and says "The resource cannot be found" - mayenne187 - 07-23-2023

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.


RE: ASP.NET MVC Page Won't Load and says "The resource cannot be found" - adorakypijnh - 07-23-2023

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 -->




RE: ASP.NET MVC Page Won't Load and says "The resource cannot be found" - bridwell156 - 07-23-2023

<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.


RE: ASP.NET MVC Page Won't Load and says "The resource cannot be found" - Winni792775 - 07-23-2023

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