enter image description here
在此处输入图像描述
enter image description here
在此处输入图像描述
enter image description here
在此处输入图像描述
https://localhost:7082/EmpList/EmployeeData/Index
when request pass the "return View()" then it can not identify view page and i want "localhost:7082" show then show the Index page directly . but i does not work
https://localhost:7082/EmpList/EmployeeData/Index当请求通过“return View()”时,它无法识别视图页面,我希望“localhost:7082”显示,然后直接显示索引页面。但我不工作
更多回答
优秀答案推荐
I have seen your images and found that you have hard coded the end points with EmpList. Instead that you should do the following
我看过你的图片,发现你已经用EmpList硬编码了终点。相反,您应该执行以下操作
endpoints.MapControllerRoute("area", "{area:exists}/{controller=Home}/{action=Index}/{id?}");
And then in controller, you need to specify the area like below. This single configuration will work for multiple areas
然后在控制器中,您需要指定如下区域。此单一配置适用于多个区域
[Area("Products")]
public class ProductController: Controller
{
}
[Area("EmpList")]
public class EmployeeDataController: Controller
{
}
更多回答
我是一名优秀的程序员,十分优秀!