ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Setting DropDown Style
Title:
B
I
{code}
?
I'm using boostrap in my app, and would like to set this style to all controls. I try to use @Html.Awe().AjaxDropdown("").CssClass("form-control") but the style i set to parent div and not to select control <div class="awe-ajaxdropdown-field awe-field form-control"><input data-notr="1" name="LanguageId" id="LanguageId" class="awe-val" value="2" data-val-required="Il campo Lingua è obbligatorio." data-val-number="The field Lingua must be a number." data-val="true" type="hidden"> <select class="awe-display" id="LanguageId-awed">
Save Changes
Cancel
Meccanica Rossi
asked at 12 Jul 2017
use `.HtmlAttributes(null, new {@class = "myclass"})`
at 12 Jul 2017
Omu
In this way set class to (hidden)<input> control not <select> control <div class="awe-ajaxdropdown-field awe-field"> <input data-notr="1" class="form-control awe-val" name="LanguageId" id="LanguageId" value="4" data-val-required="Il campo Lingua è obbligatorio." data-val-number="The field Lingua must be a number." data-val="true" type="hidden"> <select class="awe-display" id="LanguageId-awed">
at 12 Jul 2017
Meccanica Rossi
ok, seems that you'll have to use jquery to set the class, something like this: $(function(){ $('.awe-ajaxdropdown-field select').addClass('myclass'); });` $(document).ajaxComplete(function () { $('.awe-ajaxdropdown-field select').addClass('myclass'); });
at 12 Jul 2017
Omu
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK