微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Kendo UI MVC 的密码文本框

如何解决Kendo UI MVC 的密码文本框

我想使用 Telerik Kendo UI 文本框创建登录页面,因此我需要屏蔽我的密码输入。有没有人有什么建议?我试过了:

                .TextBoxFor(m => m.Password)
                .HtmlAttributes(new { type = "password" })

以下是我的标准代码

  @(Html.Kendo().TextBox()
                .Name("password")
                .Placeholder("Password")
                .Label(label => label
                    .Content("Password")
                    .Floating(true)
                )
                .HtmlAttributes(new { style = "width: 100%;border-radius: 7px;border-color: #ff4d41;" })
            )

进入舞台我会更快创建自己的文本框lol

解决方法

根据我对你的问题的理解 您需要在剑道 UI 控件中添加 type="password"

喜欢下面的代码

 @(Html.Kendo().TextBox()
.Name("password")
.Placeholder("Password")
.Label(label => label
.Content("Password")
.Floating(true)
)
.HtmlAttributes(new {type="password",style = "width: 100%;border-radius: 7px;border-color: #ff4d41;" })
)      

输出 Image

我们知道 Password HTML helper 在 MVC 中可用。

@Html.Password()
@Html.PasswordFor()

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。