2.0 Themes = Big Fat Humongous Pages

Discussion in 'ASP .Net' started by clintonG, Mar 28, 2006.

  1. clintonG

    clintonG Guest

    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
    clintonG, Mar 28, 2006
    #1
    1. Advertising

  2. clintonG

    Jeff Lynch Guest

    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>


    --
    Jeff Lynch
    "Ramblings From A [Microsoft] Connected Universe"
    http://codebetter.com/blogs/jeff.lynch


    "clintonG" <> wrote in message
    news:...
    > 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
    >
    Jeff Lynch, Mar 28, 2006
    #2
    1. Advertising

  3. clintonG

    q Guest

    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.
    q, Mar 28, 2006
    #3
  4. clintonG

    Jeff Lynch Guest

    Clinton,

    I've never tried it in ASP.NET 2.0 but it should work.

    --
    Jeff Lynch
    "Ramblings From A [Microsoft] Connected Universe"
    http://codebetter.com/blogs/jeff.lynch


    "clintonG" <> wrote in message
    news:%...
    > 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
    >
    >
    > "Jeff Lynch" <> wrote in message
    > news:O$...
    >> 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>
    >>
    >>
    >> --
    >> Jeff Lynch
    >> "Ramblings From A [Microsoft] Connected Universe"
    >> http://codebetter.com/blogs/jeff.lynch
    >>
    >>
    >> "clintonG" <> wrote in
    >> message news:...
    >>> 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
    >>>

    >>
    >>

    >
    >
    Jeff Lynch, Mar 28, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. axter
    Replies:
    16
    Views:
    3,233
    Thomas G. Marshall
    Feb 27, 2005
  2. Shaguf
    Replies:
    0
    Views:
    326
    Shaguf
    Dec 24, 2008
  3. Dave Howell
    Replies:
    2
    Views:
    81
    Wilson Bilkovich
    Dec 21, 2005
  4. 88888 Dihedral
    Replies:
    5
    Views:
    350
    88888 Dihedral
    Mar 1, 2012
  5. richard
    Replies:
    0
    Views:
    763
    richard
    Apr 13, 2012
Loading...

Share This Page