Asp.net core mvc 如何在子文件夹中使用Html.BeginForm

Asp.net core mvc 如何在子文件夹中使用Html.BeginForm,asp.net-core-mvc,.net-core,Asp.net Core Mvc,.net Core,这是在本地主机上工作的代码 查看通知/Index.cshtml: @using(Html.BeginForm("Index","Notification",FormMethod.Post)) { ... 但它不能在服务器上工作。 当我点击提交按钮时,这是url http://test.com/Notification 我想要这个网址 http://test.com/subfolder/Notification 它有子文件夹,因为我在服务器上使用docker。尝试以下操作: Html.Be

这是在本地主机上工作的代码

查看通知/Index.cshtml:

@using(Html.BeginForm("Index","Notification",FormMethod.Post))
{
 ...
但它不能在服务器上工作。 当我点击提交按钮时,这是url

http://test.com/Notification
我想要这个网址

http://test.com/subfolder/Notification
它有子文件夹,因为我在服务器上使用docker。

尝试以下操作:

Html.BeginForm("Index", "Notification", new {area="subfolder"}, FormMethod.Post)
但我建议你重写你的代码