Re: CSS on controls overrides CSS on themes

Discussion in 'ASP .Net' started by randy.buchholz, Aug 21, 2008.

  1. Clearly you are totally missing the question. It is not grouping.

    "HillBilly" <> wrote in message
    news:%...
    > Once a CssClass property is bound to a control we have to use PreInit to
    > reference the control to change the CssClass property. Read the
    > documentation for LinkButton which will help you understand how to name
    > and find a unique instance of a control by its ID or oother arguments that
    > are supported even if you are not using LinkButtons as the same Command
    > events are pertinent to other bound controls and I mention LinkButtons
    > because its easy to find and read what we are being informed of. The same
    > is true for the SkinID. Please stop using the lame "AND" terminology and
    > learn the correct terms. What you seem to be referring to is called
    > grouping when the context is CSS.
    >
    > "randy.buchholz" <> wrote in message
    > news:...
    >>I guess I'm not communicating clearly or misunderstanding your response.
    >>Let me try again :)
    >>
    >> On an individual control I can apply multiple classes:
    >> CssClass="CssClass1 CssClass2... CssClassN".
    >> Declared this way I can essentially "AND" all of the unique attributes in
    >> all applied CssClasses. (Of course non-unique attributes can't "AND")
    >>
    >> If I want to apply CssClass1 to all instances of one type of control I
    >> can reference the class in a Theme, and that CssClass is bound to all
    >> instances of that control. Effectively creating something acting like
    >> (syntax created for discussion) : CssClass="[Theme]CssClass1" for every
    >> instance. The CssClass attribute value at the control's property level
    >> is empty.
    >>
    >> I then want to ADDITIONALLY apply CssClass2...CssClassN to only a single
    >> instance of a control even though there are several other instances of
    >> the control on the same page. Creating something equivalent to
    >> CssClass="[Theme]CssClass1 CssClass2 CssClass3...."
    >>
    >> The result of adding CssClass="CssClass2 CssClass3...." to the single
    >> instance CssClass property is not equivalent to:
    >> CssClass="[Theme]CssClass1 CssClass2 CssClass3...." , but becomes simply
    >> CssClass="CssClass2 CssClass3...." The entire Theme Class
    >> ([Theme]CssClass1) is ignored, not just overridden values.
    >>
    >> Thanks for hanging in here with me.
    >>
    >>
    >> "HillBilly" <> wrote in message
    >> news:...
    >>> Have you tried marking specific controls with EnableTheme="false" and
    >>> applying your style inline? What is really occurring is a matter of
    >>> state and class inheritence which the Theme and StyleSheetTheme control
    >>> in different ways. As I understand your objective you should be using a
    >>> StyleSheetTheme which allows you to reference controls after the DOM has
    >>> been generated.
    >>>
    >>> It is more pertinent to use server-side terminology and class
    >>> inheritance describing the Theme as early-bound binding and the
    >>> StyleSheeTheme late-bound binding; early bound binds style to the
    >>> objects as the page is being generated during Init and before PreRender
    >>> and the other late-bound during the PreRender event when the DOM has
    >>> already been constructed. This is why for example we must use PreInit to
    >>> reference Themes and MasterPages as they require early-bound references
    >>> before the objects are styled and bound to the page during Init which
    >>> follows.
    >>>
    >>> "randy.buchholz" <> wrote in message
    >>> news:...
    >>>> Thanks, and while this is helpful in other cases, and does show how to
    >>>> "AND" some CSS, it doesn't really address the specific question since
    >>>> these are both still page-level themes. There seem to be three
    >>>> levels/scopes of CSS - "Application Scope", "Page Scope", and "Control
    >>>> Scope". The Application Scope and Page Scope can be "ANDed" using the
    >>>> approach you suggest, but Control Scope CSS overrides both Application
    >>>> and Page CSS. I am looking for a way to "AND" page-level (Themes or
    >>>> StyleSheetThemes CSS) with Control level CSS.
    >>>>
    >>>> Say I have page-level themes set to define the look of GridViews. By
    >>>> default a second Grid will follow below the first. If I want them side
    >>>> by side I would need to add: 'float left' to the style of the first. I
    >>>> would like to be able to just add the 'float' to the Control CSS and
    >>>> "AND" it to the Page-Level stack. But when specifying CSS at Control
    >>>> level it does not "AND" with the Page-Level CSS, it overrides it. I
    >>>> could clone the Theme for the grid, add the 'float', and them apply
    >>>> this new class at Control level, but then I have to keep the page and
    >>>> control level classes in sync - poor and messy OO.
    >>>>
    >>>> "HillBilly" <> wrote in message
    >>>> news:%...
    >>>>> Search and learn the two different ways style is applied to the DOM
    >>>>> when using the Theme compared to the StyleSheetTheme both of which
    >>>>> remain consistent when also using Skins.
    >>>>>
    >>>>>
    >>>>> "randy.buchholz" <> wrote in message
    >>>>> news:...
    >>>>>>I have a set of CSS sytles that I am reusing in many places include
    >>>>>>Themes.
    >>>>>> If I create a Theme that uses CSS I can't add additional CSS at the
    >>>>>> control level.
    >>>>>> Simple Example:
    >>>>>>
    >>>>>> .OpenRight
    >>>>>> {
    >>>>>> float: left;
    >>>>>> }
    >>>>>>
    >>>>>> .BorderFrame
    >>>>>> {
    >>>>>> border: 1px solid #000000;
    >>>>>> padding: 10px;
    >>>>>> margin: 15px;
    >>>>>> overflow: hidden;
    >>>>>> text-align: center;
    >>>>>> }
    >>>>>>
    >>>>>> I can apply both styles at control level <asp:xxx .... CssClass="
    >>>>>> BorderFrame OpenRight".../> which works fine.
    >>>>>>
    >>>>>> If I create a Theme that uses CSS:
    >>>>>>
    >>>>>> <asp:panel
    >>>>>> runat="Server"
    >>>>>> CssClass="BorderFrame"
    >>>>>> </asp:panel>
    >>>>>>
    >>>>>> It works fine at applying the BorderFrame CSS.
    >>>>>>
    >>>>>> If I try to then add CSS at the control level: <asp:panel ID...
    >>>>>> runat... CssStyle="OpenRight" ../> the control level CSS overrides
    >>>>>> the Theme CSS (as it should). Is there a way to get both the Theme
    >>>>>> CSS and Control CSS to work together?
    >>>>>>
    >>>>>>
    >>>>>
    >>>>
    >>>>
    >>>

    >>
    >>

    >
     
    randy.buchholz, Aug 21, 2008
    #1
    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. Andreas Klemt
    Replies:
    0
    Views:
    475
    Andreas Klemt
    Jul 4, 2003
  2. David Waz...
    Replies:
    0
    Views:
    412
    David Waz...
    Jul 4, 2003
  3. Jim Heavey

    C# to VB Overrides

    Jim Heavey, Oct 29, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    3,231
    Jim Heavey
    Oct 29, 2003
  4. mirek
    Replies:
    2
    Views:
    350
    mirek
    Feb 16, 2004
  5. TJS

    insert message with overrides

    TJS, May 6, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    322
    =?Utf-8?B?S2FzaHlwYQ==?=
    May 6, 2004
Loading...

Share This Page