Use "Class" to display CSS data in ASP.NET

Discussion in 'ASP .Net Building Controls' started by Grey, Jan 13, 2004.

  1. Grey

    Grey Guest

    Dear all

    As I know, I can use "Class" attribute in ASP to render the HTML control with some CSS properties. I want to know that is it the same effect in ASP.NET? But I found it is not.

    Below is my code. Please suggest the correction, if I wrong. If not, how can i use CSS in ASP.NET

    <asp:button class="btn" id="btnLogin" runat="server" Text="Login"></asp:button
    Grey, Jan 13, 2004
    #1
    1. Advertising

  2. Grey

    Rocky Moore Guest

    "Grey" <> wrote in message
    news:#...
    Dear all

    As I know, I can use "Class" attribute in ASP to render the HTML control
    with some CSS properties. I want to know that is it the same effect in
    ASP.NET? But I found it is not.

    Below is my code. Please suggest the correction, if I wrong. If not, how can
    i use CSS in ASP.NET

    <asp:button class="btn" id="btnLogin" runat="server"
    Text="Login"></asp:button

    --

    Server controls have a CssClass property for that. Simply use
    CssClass="btn" instead of class=


    --
    Rocky Moore
    www.HintsAndTips.com
    Rocky Moore, Jan 13, 2004
    #2
    1. Advertising

  3. Grey

    Rocky Moore Guest

    I hope this is not duplicated, I posted a reply but did not see it show up
    while others did. So if this is a duplicate, sorry!

    Server controls have a CssClass property for that. Simply use
    CssClass="btn" instead of class=

    --
    Rocky Moore
    www.HintsAndTips.com

    "Grey" <> wrote in message
    news:#...
    Dear all

    As I know, I can use "Class" attribute in ASP to render the HTML control
    with some CSS properties. I want to know that is it the same effect in
    ASP.NET? But I found it is not.

    Below is my code. Please suggest the correction, if I wrong. If not, how can
    i use CSS in ASP.NET

    <asp:button class="btn" id="btnLogin" runat="server"
    Text="Login"></asp:button
    Rocky Moore, Jan 13, 2004
    #3
    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. Grey
    Replies:
    2
    Views:
    383
    Rocky Moore
    Jan 13, 2004
  2. =?Utf-8?B?QW5kcmV3?=

    In asp.net, .css file is encouraged to use?

    =?Utf-8?B?QW5kcmV3?=, Nov 9, 2005, in forum: ASP .Net
    Replies:
    10
    Views:
    779
    Juan T. Llibre
    Nov 10, 2005
  3. E11
    Replies:
    1
    Views:
    4,684
    Thomas Weidenfeller
    Oct 12, 2005
  4. SeanInSeattle
    Replies:
    5
    Views:
    130
    SeanInSeattle
    Dec 13, 2007
  5. κÖлª
    Replies:
    2
    Views:
    112
    Thomas 'PointedEars' Lahn
    Jan 3, 2008
Loading...

Share This Page