我的RedirectToAction返回HTTP 404,除了控制器,动作和视图在那里,正确拼写正确的大写字母 . 我在SubscriberController中,我想在CreateTestController中调用一个动作 .
这是我的初始网址:
http://www.localdomain.com/Subscriber/AuthUser
这将启动包含多个表单的页面,我正在使用此页面调用的页面如下:
<form id="btnform7" action="LaunchTestPortal" method="post">
<input name="__RequestVerificationToken" id="antiforge7" type="hidden" value="rzTdAi...aj501">
<button title="Create, Edit or Review Training" class="ui...active" id="btnLaunchTestPortal" role="button" style="width: 13em; height: 22px; margin-bottom: 10px;" type="submit">
<span class="ui-text-only">Create, Edit or Review Training</span>
</button>
</form>
这成功地在SubscriberController中调用此方法
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult LaunchTestPortal()
{
return RedirectToAction("CreateTestPortal", "CreateTest");
}
这是我想在CreateTestController中调用的方法
[HttpPost]
[ValidateAntiForgeryToken]
public ViewResult CreateTestPortal()
{
...
}
在调用之后,这是它返回的地址 http://www.localdomain.com/CreateTest/CreateTestPortal
除了页面结果是找不到HTTP 404 . 所有零件都在那里 . 只是controllerA中的重定向不会调用controllerB中的方法
1 回答
我在评论中添加了评论,以便您可以学习 .
AuthUser.cshtml
CreateTestPortal.cshtml