GlobaLevel
asked on
vb.net - How do I add css to a web user control?
I have a web User control and I am curious how one adds CSS to it....everything I have tried, doesnt seem to work...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
P.S.
You won't be able to see this effect in the VS designer for the UC. There may be a way to specify the stylesheet the UC will use in the end (for testing purposes), but I am not certain--not that I've looked incredibly hard for it. I usually just try running the page to see the output = )
You won't be able to see this effect in the VS designer for the UC. There may be a way to specify the stylesheet the UC will use in the end (for testing purposes), but I am not certain--not that I've looked incredibly hard for it. I usually just try running the page to see the output = )
ASKER
Hi Kaufmed,
I add CssClass="format_controls" to all the controls including the UC...but at runtime all the controls format correctly except the UC, which I found weird...the CSS didnt impact it at all...
I add CssClass="format_controls"
And the page hosting the UC has the appropriate stylesheet imported?
Open in new window
Let's also say that I have a UserControl that has a Label, and this label has its CssClass set to "thisIsBlue"; I also insert an instance of the UC into the page's designer. Since the UC will be turned into markup that is inserted within the markup of the page, when the page is rendered, the Label's rendered text will be displayed in blue.