当前位置:网站首页>Asp. Net MVC, how can the controller in the folder jump to the controller in the root directory?
Asp. Net MVC, how can the controller in the folder jump to the controller in the root directory?
2022-07-29 04:01:00 【A descendant of the sun】
Xiaobian developed some pages not long ago , The controller corresponding to each view should be aligned session Non empty verification , I thought it was perfect, but I didn't expect that the link given to me by the tester today was not adjusted session by null Login page when , What's more strange is that , Some pages can jump normally, and some pages cannot jump normally , After debugging step by step, Xiaobian finally found the problem , It is normal to jump when all controllers are under the root directory , Controllers not in the same directory also have different jump methods , Let's have a look
In the same directory , Normal jump
return RedirectToAction("MyList", "Treausre");
When you need to jump in different areas , We need to add routing items
return RedirectToAction("Index", "Home", new {
area = "Admin" });
If you want to jump from an area to the root directory ( Outside the area ) Controller view of ,area Item set to empty "" That's it
return RedirectToAction("Index", "Home", new {
area = "" });
Reference article Asp.Net MVC How the controller jumps to other areas (Area) Action results in (ActionResult)
Not long ago, I chatted with my cohabiting friends about work , He showed me his project , As a full stack Developer , When I saw his project requirements , I told him. , I still focus on the back end C# Probably better , Why? , Because his project is too complicated , I don't think oneortwo people can handle it at all , He replied. , Of course , This project has 5 Personal development .
There is no perfect person , Only the perfect team .
边栏推荐
- 谁能详细说下mysqlRC下的半一致读和怎么样减少死锁概率?
- Meeting notice of OA project (Query & whether to attend the meeting & feedback details)
- 代码 ~ 隐藏或禁用状态栏和虚拟按键
- Typescript from getting started to mastering (XXII) namespace namespace (I)
- 一文学透MySQL表的创建和约束
- 关于ALV格式控制部分的写法
- EMD empirical mode decomposition
- Data mining -- code implementation of association analysis example (Part 2)
- nacos注册中心
- SSL==证书相关概念
猜你喜欢
CUB_ Visualization of key points in 200 bird dataset
Is the array name a pointer
OA项目之会议通知(查询&是否参会&反馈详情)
1985-2020(8个版次)全球地表覆盖下载与介绍
First knowledge of C language (3)
Meeting notice of OA project (Query & whether to attend the meeting & feedback details)
从2019 年开始,你一定停止使用了这个营销策略…
SQL window function
How to understand clock cycle and formula CPU execution time = number of CPU clock cycles / dominant frequency
[BGP] small scale experiment
随机推荐
MySQL第三篇
【redis系列】字符串数据结构
The output comparison function of Tim is introduced in detail through PWM breathing lamp and PWM controlled DC motor
LVS+KeepAlived高可用部署实战应用
Nacos registry
Pointer constant and constant pointer
I. creation and constraint of MySQL table
路西法98-生活记录ing
Is the array name a pointer
The data type of symbol, a new feature of ES6
Raft protocol - process demonstration
数据挖掘——关联分析基础介绍(上)
Let variable declaration feature of ES6 new feature and its case
Const read only variable constant
1985-2020 (8 Editions) global surface coverage download and introduction
The digitalization of the consumer industry is upgraded to "rigid demand", and weiit's new retail SaaS empowers enterprises!
路由 知识
华为天才少年稚晖君做了一把模块化机械键盘,引起极客圈地震,网友:这才是真正的客制化...
JS realizes the function of one click Copy
Meeting notice of OA project (Query & whether to attend the meeting & feedback details)