In many applications we use passwords. Would love to have a field that allows for the setting of a type to "password" without templates.
.PasswordTextField() or something similar.
Hi Philip,
Yeah, the .cs model annotation attribute is the most straightforward approach and I am glad it will work for you.
Nevertheless, I will keep the feedback item open for now so others customers can check it and vote for it.
Thank you for sharing this cool idea!
Regards,
Eyup
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Hi Eyup,
Thanks for the response. I don't know if I would ever use the password outside the context of a form, so your syntax here wouldn't help me:
@(Html.Kendo().TextBox()
.Name("textbox")
.HtmlAttributes(new {type="password"})
.Value("test")
)
If I do that same syntax above within a form, it doesn't work.
items.Add()
.Field(f => f.Password)
.Label(l => l.Text("Password:"))
.Editor(field => field.TextBox().HtmlAttributes(new { type = "password " }))
That being said, I had read that validation page and hadn't thought to check the .cs model file to see if that respected the result.
Thank you!
Hello Philip,
Thank you for writing to us.
Yes, the Password type is a common requirement for a lot of applications. The .NET framework provides its built-in Data Annotation Attribute to help with this:
[Required]
[Display(Name = "Choose Password:")]
[DataType(DataType.Password)]
public string Password
{
get;
set;
}
And also, it is possible to define the textbox component as a password field directly from the server:
@(Html.Kendo().TextBox()
.Name("textbox")
.HtmlAttributes(new {type="password"})
.Value("test")
)
Do you find these options beneficial for your projects?
Regards,
Eyup
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.