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

  • Thread starter Thread starter Grey
  • Start date Start date
G

Grey

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
 
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
 
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

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
 
Back
Top