1

I am using DropDownList(), TextArea(), TextBox(), ListBox() in my aspx page. I want to apply External CSS to it not inline CSS. And I don't want apply using Id/Class. So How to apply External CSS to HTML helper Class Element by its name?

IT_INFOhUb
  • 516
  • 8
  • 21
  • 40

1 Answers1

2

controls added using HTML helper class converts the controls them to simple HTML elements/controls.

If you are adding Html.Dropdownlist() it will get converted to <select/> only at last.

So for this simply apply your css on the <select/>.

and for future simply view PageSource from browser and you will come to know in which tag your control is getting converted and you can write your css for that tags...

blue
  • 568
  • 3
  • 10
  • 30