473,466 Members | 1,313 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

CSS for ASP tags

79 New Member
Hi,

Im trying to write CSS for master page which uses a contentplaceholder and some other tools as well. I want to write CSS for menu, grids and content place holder.
Please help me out

Thank you

Regards,
Syed Ahmed Hussain
Jan 25 '09 #1
9 4873
Frinavale
9,735 Recognized Expert Moderator Expert
It's great that you want to use CSS to design the look and feel of your website.
To get started please check out the W3Schools for information on how to use CSS.

-Frinny
Jan 26 '09 #2
Ahmedhussain
79 New Member
I actually wanted to CSS for ASP tags... If its possible
Jan 27 '09 #3
Frinavale
9,735 Recognized Expert Moderator Expert
What have you tried so far?
It's really easy to set CSS for asp tags.
Simply create a CSS class and set the CssClass property of the asp.net control.

For example:
Expand|Select|Wrap|Line Numbers
  1. <asp:Panel ID="MyPanel" runat="server" CssClass="myPanelStyle"></asp:Panel>
Or, if you don't want to create a class, you can set the inline style by supplying the CSS syntax in the "style" property of the asp.net control:

For example:
Expand|Select|Wrap|Line Numbers
  1. <asp:Panel ID="MyPanel" runat="server" style="background-color:black; color:white"></asp:Panel>
Please note that not all asp.net controls will have these properties.

-Frinny
Jan 27 '09 #4
Ahmedhussain
79 New Member
I didnt tried CSS classes.

let me try this too..

Thank you

Regards,
Syed Ahmed Hussain
Jan 29 '09 #5
Frinavale
9,735 Recognized Expert Moderator Expert
I forgot to mention that you can also set the CSS style of controls in your VB or C# server side code by using the style property:
Expand|Select|Wrap|Line Numbers
  1. myPanel.Style.Add("background-color","black")
Jan 29 '09 #6
Ahmedhussain
79 New Member
Well this is more interesting. Can I use this in my CS (C sharp) files. What about the programming standards .. Would it compromise the standards?
Jan 29 '09 #7
Frinavale
9,735 Recognized Expert Moderator Expert
What standards do you think will be compromised?
Jan 29 '09 #8
Ahmedhussain
79 New Member
for example the coding standards. Differentiation b/w the presentation layers, business layers and presentation layers....

And u know many others come into play as well
Jan 30 '09 #9
Frinavale
9,735 Recognized Expert Moderator Expert
It's nice to be able to keep them separate but sometimes situations require you to be able to control the style of something server side.

For instance, say you have a Label and a TextBox and if the user enters something incorrect you need to somehow indicate this. In this case you need to be able to change the style of the Label so to identify that field is incorrect. You could do that by specifying things through the Style property:
Expand|Select|Wrap|Line Numbers
  1. myLabel.Style.Remove("background-color")
  2. myLabel.Style.Add("background-color","red")
Or by setting a new value for the CSS property:
Expand|Select|Wrap|Line Numbers
  1. myLabel.CssClass = "myErrorCssClass"
Jan 30 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: varois83 | last post by:
Hi I am fairly new to PHP/mysql and was reading an online tutorial and learned that my short tags weren't enabled. At this time I have no need for them, my setup apache/mysql/php runs on my PC...
0
by: Philippe Poulard | last post by:
People that have a knowledge of XQuery, XSLT, Ant, JSP/PHP/ASP, Cocoon, XMLBeans, taglibs and many others should recognize any of them in "Active Tags". " Active Tags is a set of specifications...
24
by: Day Bird Loft | last post by:
Web Authoring | Meta-Tags The first thing to understand in regard to Meta Tags is the three most important tags placed in the head of your html documents. They are the title, description, and...
7
by: Jasper Bryant-Greene | last post by:
I have three tables: `photos`, `tags` and `tags_photos`. The `photos` table contains a unique ID and a bunch of other stuff, the `tags` table contains a unique ID and a tag name, and the...
1
by: Jenny | last post by:
Hi, Can I create an array of tags by assigning same name to these tags? For example, I have two <p> tags with the same name t1. But document.all.b.value=document.all.t.length does not...
12
by: Oberon | last post by:
I have a large HTML document. It has hundreds of <span>s which have no attributes so these <span>s are redundant. How can I remove these tags automatically? The document also has <span>s with...
12
by: Stefan Weiss | last post by:
Hi. (this is somewhat similar to yesterday's thread about empty links) I noticed that Tidy issues warnings whenever it encounters empty tags, and strips those tags if cleanup was requested....
23
by: Big Bill | last post by:
http://www.promcars.co.uk/pages/bonnie.php I don't believe they should be there, can I take them out without stopping the includes from functioning? I'm the (hapless) optimiser on this one... I...
3
by: Paul Moore | last post by:
I'd like to write some scripts to analyze and manipulate my music files. The files themselves are in MP3 and FLAC format (mostly MP3, but FLAC where I ripped original CDs and wanted a lossless...
1
by: arrival123 | last post by:
Hello, I'm currently trying to decide on a database design for tags in my web 2.0 application. The problem I'm facing is that I have 3 separate tables i.e. cars, planes, and schools. All three...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.