Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to apply External CSS to Html Helper Class Elements?

How to apply External CSS to Html Helper Class Elements?

Problem

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?

Problem courtesy of: IT_INFOhUb

Solution

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 only at last.

So for this simply apply your css on the .

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...

Solution courtesy of: blue

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

How to apply External CSS to Html Helper Class Elements?

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×