2.0 Themes = Big Fat Humongous Pages

  • Thread starter Thread starter clintonG
  • Start date Start date
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
 
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>
 
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.
 
Hello Jeff,

Thank you. Do you have any comments about allowing a user to change a
StyleSheetTheme using a DropDownList as we can do when using the Theme?

<%= Clinton Gallagher
 

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

Back
Top