我有多种形式.NET多个表单在一个页面上的问题
@using (Html.BeginForm("Withdrawal", "ATMControl", FormMethod.Post, new {}))
{
//code
}
@using (Html.BeginForm("Deposit", "ATMControl", FormMethod.Post, new {}))
{
//code
}
@using (Html.BeginForm("transfer", "ATMControl", FormMethod.Post, new {}))
{
//code
}
在我的控制器视图:
//this works
public ActionResult Index()
{
SetViewBagAccounts();
return View();
}
//this doesnt
[HttpPost]
public ActionResult Withdrawal(ATMModel model)
{
//do your login code here
return View();
}
什么,我试图做的是过程取款,存款和转移indiviually在这个控制器中。 我不断收到此错误
找不到资源。
说明:HTTP 404.您正在查找的资源(或其某个依赖项)可能已被删除,名称已更改或暂时不可用。请检查以下网址并确保它拼写正确。
请求的URL:/ ATMControl /退学
什么是你的控制器的名称? – musefan
ATMController。我拼错了我的控制器,但我做了修复,仍然是相同的错误 – kayze
您需要删除“控制器”部分,只需在使用“ATM”时提及控制器。 MVC的魔术将解决 – musefan