Styling DIVs in an UpdatePanel

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?V2FubmFiZQ==?=

    #1

    Styling DIVs in an UpdatePanel

    when I try to style a div using the id tag, from an external style sheet, it
    is not recognized. If I change the style sheet id to a class, it is
    recognized. Is this how styling a div within an update panel supposed to work?

    Example:

    HTML
    <asp:UpdatePane l ID="UpdatePanel 1" runat="server">
    <ContentTemplat e>
    <div id="myDiv" class="myDiv">w hatever
    </div>
    </ContentTemplate >
    </UpdatePanel>

    This is not recognized in an update panel
    #myDiv
    {
    border: solid 1px blue;
    }

    This is recognized in an update panel

    ..myDiv
    {
    border: solid 1px green;
    }
  • Teemu Keiski

    #2
    Re: Styling DIVs in an UpdatePanel

    Hi,

    see:

    UpdatePanel and CSS


    --
    Teemu Keiski
    AspInsider, ASP.NET MVP




    "Wannabe" <Wannabe@discus sions.microsoft .comwrote in message
    news:E51897F0-B438-4ABB-A7FE-1BC50C5069E7@mi crosoft.com...
    when I try to style a div using the id tag, from an external style sheet,
    it
    is not recognized. If I change the style sheet id to a class, it is
    recognized. Is this how styling a div within an update panel supposed to
    work?
    >
    Example:
    >
    HTML
    <asp:UpdatePane l ID="UpdatePanel 1" runat="server">
    <ContentTemplat e>
    <div id="myDiv" class="myDiv">w hatever
    </div>
    </ContentTemplate >
    </UpdatePanel>
    >
    This is not recognized in an update panel
    #myDiv
    {
    border: solid 1px blue;
    }
    >
    This is recognized in an update panel
    >
    .myDiv
    {
    border: solid 1px green;
    }

    Comment

    • =?Utf-8?B?V2FubmFiZQ==?=

      #3
      Re: Styling DIVs in an UpdatePanel

      Thanks, but unless I missed something, that talks about styling an
      updatepanel and I want to style the DIVs that are in my updatepanel.

      "Teemu Keiski" wrote:
      Hi,
      >
      see:
      >
      UpdatePanel and CSS

      >
      --
      Teemu Keiski
      AspInsider, ASP.NET MVP


      >
      >
      "Wannabe" <Wannabe@discus sions.microsoft .comwrote in message
      news:E51897F0-B438-4ABB-A7FE-1BC50C5069E7@mi crosoft.com...
      when I try to style a div using the id tag, from an external style sheet,
      it
      is not recognized. If I change the style sheet id to a class, it is
      recognized. Is this how styling a div within an update panel supposed to
      work?

      Example:

      HTML
      <asp:UpdatePane l ID="UpdatePanel 1" runat="server">
      <ContentTemplat e>
      <div id="myDiv" class="myDiv">w hatever
      </div>
      </ContentTemplate >
      </UpdatePanel>

      This is not recognized in an update panel
      #myDiv
      {
      border: solid 1px blue;
      }

      This is recognized in an update panel

      .myDiv
      {
      border: solid 1px green;
      }
      >
      >
      >

      Comment

      • Teemu Keiski

        #4
        Re: Styling DIVs in an UpdatePanel

        The ideas presented in the post apply pretty well here. For example if your
        DIV would be a server-side control, getting the ClientID would work (in case
        you use master pages etc which impact on the IDs rendered in the end), or
        enclosing the content in another element which you can style at will.

        I suppose using classes instead of IDs would be preferred anyways for that
        reason (ASP.NET autogenerating IDs).

        --
        Teemu Keiski
        AspInsider, ASP.NET MVP





        "Wannabe" <Wannabe@discus sions.microsoft .comwrote in message
        news:F4E9775B-33AF-4697-9D21-BFF3D796DE6B@mi crosoft.com...
        Thanks, but unless I missed something, that talks about styling an
        updatepanel and I want to style the DIVs that are in my updatepanel.
        >
        "Teemu Keiski" wrote:
        >
        >Hi,
        >>
        >see:
        >>
        >UpdatePanel and CSS
        >http://weblogs.asp.net/rajbk/archive...l-and-css.aspx
        >>
        >--
        >Teemu Keiski
        >AspInsider, ASP.NET MVP
        >http://blogs.aspadvice.com/joteke
        >http://teemukeiski.net
        >>
        >>
        >"Wannabe" <Wannabe@discus sions.microsoft .comwrote in message
        >news:E51897F 0-B438-4ABB-A7FE-1BC50C5069E7@mi crosoft.com...
        when I try to style a div using the id tag, from an external style
        sheet,
        it
        is not recognized. If I change the style sheet id to a class, it is
        recognized. Is this how styling a div within an update panel supposed
        to
        work?
        >
        Example:
        >
        HTML
        <asp:UpdatePane l ID="UpdatePanel 1" runat="server">
        <ContentTemplat e>
        <div id="myDiv" class="myDiv">w hatever
        </div>
        </ContentTemplate >
        </UpdatePanel>
        >
        This is not recognized in an update panel
        #myDiv
        {
        border: solid 1px blue;
        }
        >
        This is recognized in an update panel
        >
        .myDiv
        {
        border: solid 1px green;
        }
        >>
        >>
        >>

        Comment

        • =?Utf-8?B?V2FubmFiZQ==?=

          #5
          Re: Styling DIVs in an UpdatePanel

          You're right...thanks!

          "Teemu Keiski" wrote:
          The ideas presented in the post apply pretty well here. For example if your
          DIV would be a server-side control, getting the ClientID would work (in case
          you use master pages etc which impact on the IDs rendered in the end), or
          enclosing the content in another element which you can style at will.
          >
          I suppose using classes instead of IDs would be preferred anyways for that
          reason (ASP.NET autogenerating IDs).
          >
          --
          Teemu Keiski
          AspInsider, ASP.NET MVP


          >
          >
          >
          "Wannabe" <Wannabe@discus sions.microsoft .comwrote in message
          news:F4E9775B-33AF-4697-9D21-BFF3D796DE6B@mi crosoft.com...
          Thanks, but unless I missed something, that talks about styling an
          updatepanel and I want to style the DIVs that are in my updatepanel.

          "Teemu Keiski" wrote:
          Hi,
          >
          see:
          >
          UpdatePanel and CSS

          >
          --
          Teemu Keiski
          AspInsider, ASP.NET MVP


          >
          >
          "Wannabe" <Wannabe@discus sions.microsoft .comwrote in message
          news:E51897F0-B438-4ABB-A7FE-1BC50C5069E7@mi crosoft.com...
          when I try to style a div using the id tag, from an external style
          sheet,
          it
          is not recognized. If I change the style sheet id to a class, it is
          recognized. Is this how styling a div within an update panel supposed
          to
          work?

          Example:

          HTML
          <asp:UpdatePane l ID="UpdatePanel 1" runat="server">
          <ContentTemplat e>
          <div id="myDiv" class="myDiv">w hatever
          </div>
          </ContentTemplate >
          </UpdatePanel>

          This is not recognized in an update panel
          #myDiv
          {
          border: solid 1px blue;
          }

          This is recognized in an update panel

          .myDiv
          {
          border: solid 1px green;
          }
          >
          >
          >
          >
          >
          >

          Comment

          Working...