Solved

CssClass confusion

Posted on 2008-06-10
5
350 Views
Last Modified: 2012-08-13
Greetings all

I am trying to understand ..

1.  What is the difference between the CLASS property of HTML controls and the CSSCLASS property of
     ASP.Net controls? If I create a class in my CSS file can I say "<ASPxxxxx CssClass="myClass" ?

2. When trying to set up classes for ASP controls (I am using the VS005 CSS editor (right-click on solution
    explorer... Add new item ... Select CSS Style sheet) there are properties which aren't supported (eg. if
    I try set up the "PasswordLabelText" property of the login control or, "ImageUrl" of the ASP HyperLink. I
   get  told "'PasswordLabelText' is not  a  known CSS property name."). Why is this? Do I code these
   inline (horrid! I will have to do that in more  than one place, which is why I wanted to use a class).

In advance, thanks!!

  allanmark
0
Comment
Question by:allanmark
  • 2
  • 2
5 Comments
 
LVL 8

Accepted Solution

by:
MrAgile earned 125 total points
ID: 21757478
HI There,

>> 1.  What is the difference between the CLASS property of HTML controls and the CSSCLASS property of
     ASP.Net controls? If I create a class in my CSS file can I say "<ASPxxxxx CssClass="myClass" ?

1. They are in effect the same. Think of them as attributes to a node class="myclassname" or cssclass="myclassname"

>> 
     ASP.Net controls? If I create a class in my CSS file can I say "<ASPxxxxx CssClass="myClass" ?

No. You can:

1. create an external css file and then have a class in it that is referenced by the control's css class property.
2. you can create themes which enable you to apply the css on a global level.


>> 2. When trying to set up classes for ASP controls (I am using the VS005 CSS editor (right-click on solution
    explorer... Add new item ... Select CSS Style sheet) there are properties which aren't supported (eg. if
    I try set up the "PasswordLabelText" property of the login control or, "ImageUrl" of the ASP HyperLink. I
   get  told "'PasswordLabelText' is not  a  known CSS property name."). Why is this? Do I code these
   inline (horrid! I will have to do that in more  than one place, which is why I wanted to use a class).

use one of the methods I have described above.

Sean

0
 
LVL 10

Assisted Solution

by:digitalZo
digitalZo earned 125 total points
ID: 21757484
1) No difference.

2) Go through this tutorial on how to do it: http://www.beansoftware.com/ASP.NET-Tutorials/CSS-ASP.NET.aspx

if you have any questions, please do not hesitate to ask.
0
 
LVL 10

Assisted Solution

by:digitalZo
digitalZo earned 125 total points
ID: 21757492
0
 

Author Comment

by:allanmark
ID: 21757586
DigitalZo -- Thanks for the info.  Will go through the Tuts this afternoon and post back.

MrAgile --  hope this isn't too much of a dumb question (which probably means that it is) -- by external, do you mean create something like a textfile (eg with NotePad) and then link that to my application?

Tks!
0
 

Author Closing Comment

by:allanmark
ID: 31466039
Many thanks!!!
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question