当前位置:网站首页>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边栏推荐
- Addressable 预下载
- PLC模拟量输出 模拟量输出FB analog2NDA(三菱FX3U)
- 如何设计 API 接口,实现统一格式返回?
- How to package the parsed Excel data into objects and write this object set into the database?
- If you‘re running pod install manually, make sure flutter pub get is executed first.
- Techniques d'utilisation de sublime
- ClickHouse(03)ClickHouse怎么安装和部署
- Ansible reports an error: "MSG": "invalid/incorrect password: permission denied, please try again“
- 谈谈讲清楚这件事的重要性
- 基于Bevy游戏引擎和FPGA的双人游戏
猜你喜欢
torch optimizer小解析
Batch normalization (Standardization) processing
Oracle - views and sequences
Vscode automatically adds a semicolon and jumps to the next line
[Android kotlin collaboration] use coroutinecontext to realize the retry logic after a network request fails
U++ 元数据说明符 学习笔记
基于Bevy游戏引擎和FPGA的双人游戏
【愚公系列】2022年7月 Go教学课程 005-变量
指针与数组在函数中输入实现逆序输出
How to design API interface and realize unified format return?
随机推荐
Time complexity & space complexity
5G VoNR+之IMS Data Channel概念
In depth analysis of kubebuilder
Chapter 9 Yunji datacanvas was rated as 36 krypton "the hard core technology enterprise most concerned by investors"
深入解析Kubebuilder
AttributeError: module ‘torch._C‘ has no attribute ‘_cuda_setDevice‘
Error: No named parameter with the name ‘foregroundColor‘
Addressable 预下载
想要选择一些部门优先使用 OKR, 应该如何选择试点部门?
指针与数组在函数中输入实现逆序输出
Operand of null-aware operation ‘!‘ has type ‘SchedulerBinding‘ which excludes null.
Terms used in the Web3 community
装饰器基础学习02
Read of shell internal value command
Gavin teacher's perception of transformer live class - rasa project actual combat e-commerce retail customer service intelligent business dialogue robot microservice code analysis and dialogue experim
Decorator basic learning 02
Flask project uses flask socketio exception: typeerror: function() argument 1 must be code, not str
Factor analysis r practice (with R installation tutorial and code)
最全常用高数公式
高数中值定理总结