I've manually added a view in the Home folder called "Test.cshtml".
When I opened that view in the browser it shows me the error: The resource cannot be found.
I tried the following solutions but still getting that error:
1- Right click on The Project Name > Properties > Specific Page > set it to: "Home/Test".
2- In RouteConfig class > RegisterRoutes method > Default MapRoute > set: controller = "Home", action = "Test".
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.
There is a problem with the resource you are looking for, and it cannot be displayed. To resolve this issue, set the Enable 32-bit Applications to "False": Open the Internet Information Services (IIS) Manager. Select Application Pools.
You need to add an Action
called Test
in your Home
controller.
public class HomeController : Controller
{
public ActionResult Test()
{
return View();
}
}
Visual Studio
can help you generating the view for the action, right click on the Test
method and Add View...
You can read more about Routing and Attribute Routing in this MSDN article.
Also a good read - How URLs Are Matched to Routes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With