2.0 Themes = Big Fat Humongous Pages

C

clintonG

Ever tried looking at the source? Holy Mackerel.
Is there some strategy to use CSS with Themes that does not result in the
framework generating inline styles for every HTML element of the page?
I haven't used a StyleSheetTheme yet. What does it do "in this context?"

<%= Clinton Gallagher
 
J

Jeff Lynch

The StyleSheetTheme is exactly what you're looking for. It's pretty easy.

1. Create your cascading style sheet as usual and put it into a "Theme"
ASP.NET folder in your site.
2. Add a reference to your StyleSheetTheme on each page or in the Web.Config
3. Add a skin file that references the CSS you created (see below).
4. On non-skinned controls or standard html controls just add the
CssClass="yourcssclass" property

Sample Skin Using CSS

<asp:GridView
SkinId="GridViewSkin"
runat="server"
AllowPaging="True"
AllowSorting="True"
CellPadding="5"
CellSpacing="0"
CssClass="gvtable"
EnableSortingAndPagingCallbacks="True"
GridLines="Vertical">
<AlternatingRowStyle CssClass="gvaltrow" />
<EditRowStyle />
<HeaderStyle CssClass="gvheader" />
<PagerStyle CssClass="gvfooter" />
<RowStyle CssClass="gvrow" />
<SelectedRowStyle />
</asp:GridView>
 
Q

q

I tried doing that one... forget that. Wasted a ton of time. I ended
up writing the thing manually. I'm wondering if the attributes for
Themes even work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top