当前位置:网站首页>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边栏推荐
- Ansible overview and module explanation (you just passed today, but yesterday came to your face)
- A simple and beautiful regression table is produced in one line of code~
- Ansible中的inventory主機清單(預祝你我有數不盡的鮮花和浪漫)
- JS 的 try catch finally 中 return 的执行顺序
- 2.证券投资基金的概述
- U++ 元数据说明符 学习笔记
- 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
- Comparison between thread and runnable in creating threads
- AOSP ~Binder 通信原理 (一) - 概要
- If you‘re running pod install manually, make sure flutter pub get is executed first.
猜你喜欢
Oracle - views and sequences
sublime使用技巧
How does vscade use the built-in browser?
Flask project uses flask socketio exception: typeerror: function() argument 1 must be code, not str
Windows are not cheap things
[email protected] Mapping relatio"/>
Why JSON is used for calls between interfaces, how fastjson is assigned, fastjson 1.2 [email protected] Mapping relatio
Markdown编辑器
U++ game learning notes
Batch normalization (Standardization) processing
3GPP信道模型路损基础知识
随机推荐
[digital analog] source code of MATLAB allcycles() function (not available before 2021a)
深入解析Kubebuilder
IMS data channel concept of 5g vonr+
Markdown editor
PLC模拟量输出 模拟量输出FB analog2NDA(三菱FX3U)
sublime使用技巧
[736. LISP syntax parsing]
R language principal component PCA, factor analysis, clustering analysis of regional economy analysis of Chongqing Economic Indicators
基于Bevy游戏引擎和FPGA的双人游戏
AttributeError: module ‘torch._ C‘ has no attribute ‘_ cuda_ setDevice‘
DBSync新增对MongoDB、ES的支持
A simple and beautiful regression table is produced in one line of code~
C语言中函数指针与指针函数
【Android Kotlin协程】利用CoroutineContext实现网络请求失败后重试逻辑
JS variable
STM32F103 realize IAP online upgrade application
Inventory host list in ansible (I wish you countless flowers and romance)
Ansible概述和模块解释(你刚走过了今天,而扑面而来的却是昨天)
最全常用高数公式
窗口可不是什么便宜的东西