当前位置:网站首页>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边栏推荐
- If you ask me about R code debugging, I will tell you head, STR, help
- 【數模】Matlab allcycles()函數的源代碼(2021a之前版本沒有)
- NiO related knowledge points (I)
- Monitoring cannot be started after Oracle modifies the computer name
- Ansible overview and module explanation (you just passed today, but yesterday came to your face)
- R language principal component PCA, factor analysis, clustering analysis of regional economy analysis of Chongqing Economic Indicators
- Analysis -- MySQL statement execution process & MySQL architecture
- Weebly mobile website editor mobile browsing New Era
- npm ERR! 400 Bad Request - PUT xxx - “devDependencies“ dep “xx“ is not a valid dependency name
- 基于Bevy游戏引擎和FPGA的双人游戏
猜你喜欢
Leetcode(46)——全排列
深入解析Kubebuilder
Flask项目使用flask-socketio异常:TypeError: function() argument 1 must be code, not str
Section 1: (3) logic chip process substrate selection
深入解析Kubebuilder
U++ game learning notes
【736. Lisp 语法解析】
记录一次压测经验总结
AttributeError: module ‘torch._ C‘ has no attribute ‘_ cuda_ setDevice‘
Time complexity & space complexity
随机推荐
全国气象数据/降雨量分布数据/太阳辐射数据/NPP净初级生产力数据/植被覆盖度数据
[Android kotlin collaboration] use coroutinecontext to realize the retry logic after a network request fails
Mysql database (basic)
Why is the salary of test and development so high?
sublime使用技巧
leetcode 53. Maximum subarray maximum subarray sum (medium)
Ansible reports an error: "MSG": "invalid/incorrect password: permission denied, please try again“
Two methods of chromosome coordinate sequencing
Test interview | how much can you answer the real test interview question of an Internet company?
Weebly移动端网站编辑器 手机浏览新时代
01机器学习相关规定
U++ 游戏类 学习笔记
2.证券投资基金的概述
STM32F103实现IAP在线升级应用程序
AttributeError: module ‘torch._C‘ has no attribute ‘_cuda_setDevice‘
接口间调用为什么要用json、fastjson怎么赋值的、fastjson [email protected]映射关系问题
《二》标签
How to choose an offer and what factors should be considered
[hand torn STL] list
【二叉树】二叉树寻路