This question is locked. New answers and comments are not allowed.
Hi,
I'm trying to add HTML attributes to the hidden input of the DropDownList. I've tried using the DropDownHtmlAttributes() method, but it doesn't seem to do anything.
Is how I'm binding the data to my DropDownList. Is there a way to have my attributes added to the hidden input tag?
I suppose this issue is very much related to Client side validation on a DropDownList (data-val, data-val-required and such don't get added to the input).
I'm trying to add HTML attributes to the hidden input of the DropDownList. I've tried using the DropDownHtmlAttributes() method, but it doesn't seem to do anything.
@(Html.Telerik().DropDownListFor( x => x.value ) .BindTo( list ) .DropDownHtmlAttributes( new Dictionary<string, object> { { "data-foo", "baz" }, { "data-bar", "random" } } ))Is how I'm binding the data to my DropDownList. Is there a way to have my attributes added to the hidden input tag?
I suppose this issue is very much related to Client side validation on a DropDownList (data-val, data-val-required and such don't get added to the input).
