如何关闭自动完成关闭在asp.net MVC一个Ajax形式

编程入门 行业动态 更新时间:2024-10-17 13:29:41
本文介绍了如何关闭自动完成关闭在asp MVC一个Ajax形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经创建了剃须刀一个Ajax形式。但我需要关闭自动完成整个中的形式。在一个正常的形式,我可以通过HTML属性自动完成=关闭,但我找不到只接受一个最好的超载 AjaxOptions 和 htmlAttributes (任何类型)

I have created an Ajax form in razor. But I need to turn off auto-completion in entire form. In a normal form, I could pass html attribute autocomplete = "off" but I can't find a best overload that accepts only AjaxOptions and htmlAttributes (of any type)

好此页面没有说明所有 Ajax.BeginForm 17重载()。它只有11定义在那里。

Well this page does not describe all of 17 overloads of Ajax.BeginForm(). It has only 11 definitions there.

那么我的函数调用就像

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)

请告诉我哪一个是我可以利用没有任何其他功能的影响。或任何其他的解决方案中添加自动完成=关闭在格式标记..?

Please tell me which one is that I can make use of without any other functional effect. Or any other solution to add autocomplete="off" in form tag..?

推荐答案

试试这个,

@using (Ajax.BeginForm("Index", "Home", null, new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "result" }, new {autocomplete ="off"}) )

更多推荐

如何关闭自动完成关闭在asp.net MVC一个Ajax形式

本文发布于:2023-11-24 22:52:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627201.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自动完成   形式   asp   net   MVC

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!