gpt4 book ai didi

c# - Ajax.BeginForm 在给定 actionName 和 controllerName 后不输出表单操作

转载 作者:行者123 更新时间:2023-11-30 21:07:36 24 4
gpt4 key购买 nike

非常标准的代码

 using (Ajax.BeginForm("Search", "Subscriber", null, 
new AjaxOptions
{
OnBegin = "ajaxBegin",
OnFailure = "ajaxFailure",
OnSuccess = "ajaxSuccess"
},
new{id = "ajax1121"})
{
}

它的输出 <form action="" ...>行动是空的!我尝试通过删除 ajaxoptions 等用另一个重载更改代码,没有用

最令人惊奇的是,相同的代码可以在另一个区域工作。我什至尝试复制 _ViewStart.cshtmlWeb.config从区域到问题区域的文件,仍然无法正常工作。该地区有问题名称 Mail

有什么想法吗?

最佳答案

是的,没有客户端。不要输入你的 Controller 名称,而是输入 Route 对象

using (Ajax.BeginForm("Search", new { Controller = "Subscriber", area = "area name here"}, null, new AjaxOptions { OnBegin = "ajaxBegin", OnFailure = "ajaxFailure", OnSuccess = "ajaxSuccess" },new{id = "ajax1121"}){
}

关于c# - Ajax.BeginForm 在给定 actionName 和 controllerName 后不输出表单操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10285585/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com