当前位置:网站首页>ASP. Net MVC - resource cannot be found error - asp Net MVC – Resource Cannot be found error
ASP. Net MVC - resource cannot be found error - asp Net MVC – Resource Cannot be found error
2022-07-07 05:04:00 【fyin1314】
problem :
I am completely new to ASP.Net MVC. I am a ASP.Net MVC novice .I just created an MVC3 project in Visual Studio 2010. The view engine is razor. I was just in Visual Studio 2010 Creates one in MVC3 project . The view engine is a razor .When I just ran the application it gave the proper result in the browser. When I first ran the application , It gives the correct result in the browser .The URL is http://localhost:4163/ .URL by http:// localhost:4163 / .Then I applied “Set as Start Page” to Index.cshtml inside ~\\Views\\Home folder. Then I will “ Set to start page ” be applied to 〜\\ Views \\ Home In folder Index.cshtml.Then when I ran the application the url became http://localhost:4148/Views/Home/Index.cshtml and it said the resource cannot be found. Then when I run the application ,url Turned into http:// localhost:4148 / Views / Home / Index.cshtml , It said that the resource could not be found .What do I do to correct it? What can I do to correct it ?Where is the url mapping done? Where is the URL mapping completed ?
Global.asax file:Global.asax file :
using System.Web.Mvc;using System.Web.Routing;namespace TEST{public class MvcApplication : System.Web.HttpApplication{ public static void RegisterGlobalFilters(GlobalFilterCollection filters) { filters.Add(new HandleErrorAttribute()); } public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); } protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); } } }Solution :
Reference resources : https://stackoom.com/en/question/czje边栏推荐
- 2.证券投资基金的概述
- 全国气象数据/降雨量分布数据/太阳辐射数据/NPP净初级生产力数据/植被覆盖度数据
- 使用知云阅读器翻译统计遗传学书籍
- Local tool [Navicat] connects to remote [MySQL] operation
- Talk about the importance of making it clear
- Error: No named parameter with the name ‘foregroundColor‘
- Time complexity & space complexity
- Why is the salary of test and development so high?
- Section 1: (3) logic chip process substrate selection
- [practice leads to truth] is the introduction of import and require really the same as what is said on the Internet
猜你喜欢

How to choose an offer and what factors should be considered

《二》标签

Analysis -- MySQL statement execution process & MySQL architecture

MySQL数据库(基础篇)

Flex layout and usage

Meow, come, come: do you really know if, if else

U++ 游戏类 学习笔记

JDBC link Oracle reference code

If you‘re running pod install manually, make sure flutter pub get is executed first.

Liste des hôtes d'inventaire dans ansible (je vous souhaite des fleurs et de la romance sans fin)
随机推荐
Leetcode longest public prefix
[Yugong series] go teaching course 005 variables in July 2022
3. Type of fund
Leetcode(46)——全排列
装饰器基础学习02
C语言中函数指针与指针函数
Flask project uses flask socketio exception: typeerror: function() argument 1 must be code, not str
npm ERR! 400 Bad Request - PUT xxx - “devDependencies“ dep “xx“ is not a valid dependency name
Clickhouse (03) how to install and deploy Clickhouse
Field data acquisition and edge calculation scheme of CNC machine tools
Servicemesh mainly solves three pain points
谈谈讲清楚这件事的重要性
Markdown editor
No experts! Growth secrets for junior and intermediate programmers and "quasi programmers" who are still practicing in Universities
01机器学习相关规定
使用Thread类和Runnable接口实现多线程的区别
[hand torn STL] list
STM32F103 realize IAP online upgrade application
Monitoring cannot be started after Oracle modifies the computer name
CentOS 7.9安装Oracle 21c历险记