我已经用剃刀创建了一个Ajax表单。但是我需要关闭整个形式的自动完成功能。以正常形式,我可以传递html属性,autocomplete = "off"
但是找不到仅接受AjaxOptions
和htmlAttributes
(任何类型)的最佳重载
好吧,此页面未介绍的全部17个重载Ajax.BeginForm()
。那里只有11个定义。
好吧,我的函数调用看起来像
using (Ajax.BeginForm(new AjaxOptions() { ... }))
{
...
}
我列出了一些重载,这些重载包含htmlAttribute
其定义中的任何类型。
Ajax.BeginForm(string actionName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes)
Ajax.BeginForm(string actionName, string controllerName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes)
Ajax.BeginForm(string actionName, string controllerName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary<string,object> htmlAttributes)
Ajax.BeginForm(string actionName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary<string,object> htmlAttributes)
AjaxBeginForm(string actionName, string controllerName, object routeValues, FormMethod method, object htmlAttributes)
请告诉我,我可以使用哪一个而没有任何其他功能效果。或任何其他的解决方案中添加autocomplete="off"
的form
标签..?
试试这个,
@using (Ajax.BeginForm("Index", "Home", null,
new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "result" },
new {autocomplete ="off"})
)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句