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

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
 
R

Rocky Moore

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
 
R

Rocky Moore

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top