当前位置:网站首页>Asp.net MVC中文件夹中的控制器如何跳转到根目录的控制器中?
Asp.net MVC中文件夹中的控制器如何跳转到根目录的控制器中?
2022-07-29 03:58:00 【太阳的后裔】
小编前不久开发一些页面,每个视图对应的控制器都要进行对session非空验证,本以为已经很完美没想到今天测试人员给我的链接我点进去却没有调到session为null时的登录页面,更奇怪的是,有些页面可以正常跳转有些页面不能正常跳转,小编一步一步的调试终于发现了问题所在,就是当都在根目录下的控制器时跳转是正常的,而不在同一目录下的控制器也有不同的跳转方式,来一睹为快吧
同一目录下,正常跳转
return RedirectToAction("MyList", "Treausre");
当需要在不同区域内进行跳转时,我们需要添加路由项
return RedirectToAction("Index", "Home", new {
area = "Admin" });
如果要从某个区域跳转到根目录下(区域外)的控制器视图,area项设置为空""就行了
return RedirectToAction("Index", "Home", new {
area = "" });
参考文章Asp.Net MVC 控制器如何跳转到其他区域(Area)中的动作结果(ActionResult)
前不久和同居的朋友聊了一下关于工作上的事,他给我看了一下他的项目,作为一个全栈开发人员,当我看到他的项目需求后,我跟他说,我还是主攻后端C#可能比较好,为什么,因为他的那个项目实在太复杂了,我觉得根本不是一两个人可以搞定,他回答道,那当然了,这个项目一共有5个人开发。
没有完美的个人,只有完美的团队。
边栏推荐
- Sunflower senior product director technology sharing: "how to apply national remote control" in AD domain environment
- 1985-2020 (8 Editions) global surface coverage download and introduction
- 【C语言入门】ZZULIOJ 1031-1035
- What have I learned from 200 machine learning tools?
- EMD empirical mode decomposition
- Process tracking of ribbon principle
- What you see and think in Microsoft
- Raft protocol - process demonstration
- 初识C语言(3)
- String template of ES6 new features and methods to simplify objects and functions
猜你喜欢

Malloc C language

I.MX6U-驱动开发-2-LED驱动

Interview essential! TCP classic 15 consecutive questions!

Cloudera manager platform fault repair record

大厂们终于无法忍受“加一秒”了,微软谷歌Meta等公司提议废除闰秒

HCIP BGP

向日葵远程控制为何采用BGP服务器?自动最优路线、跨运营商高速传输

The digitalization of the consumer industry is upgraded to "rigid demand", and weiit's new retail SaaS empowers enterprises!

CUB_ Visualization of key points in 200 bird dataset

Ssl== certificate related concepts
随机推荐
【BGP】小型实验
1. 头文件-注释-命名空间-标准输入输出流
JS cookie usage
tron OUT_ OF_ ENERGY
Opensql quick learning
Typescript from getting started to mastering (XXIII) namespace namespace (Part 2)
[introduction to C language] zzulioj 1031-1035
Shutter start white screen
《陌路曾相逢》夏陌沈疏晏_夏陌沈疏晏最新章节
【redis系列】字符串数据结构
How fast does it take to implement a super simple programming language?
Flutter 启动白屏
SQL window function
Let variable declaration feature of ES6 new feature and its case
Arrow function of new features of ES6
Ssl== certificate related concepts
Routing knowledge
Why do many programmers hate pair programming?
Some notes on uniapp
Typescript from entry to mastery (XVIII) joint type and type protection