473,378 Members | 1,441 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Applying CSS Styles to Dropdownlist

Is there a problem with asp.net 2 when setting the Csstyle. I have a CSS
stylesheet and can format different elements, but having trouble formatting
the asp.net controls , such as dropdownlist.

Thanks

Neil
May 15 '06 #1
4 10211
<script language="VB" runat="server">
Sub Page_Load(ByVal Src As Object, ByVal E As EventArgs)
Dim MyStyle As New Style
MyStyle.BackColor = Drawing.Color.Aqua
DropDownList1.ApplyStyle(MyStyle)
End Sub
</script>

Not all properties can be changed, though.

Also, see the source code for a custom web control written by Fabrice Marguerie :
http://weblogs.asp.net/fmarguerie/ar...2/27/3103.aspx

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neil Steventon" <Ne***********@discussions.microsoft.com> wrote in message
news:13**********************************@microsof t.com...
Is there a problem with asp.net 2 when setting the Csstyle. I have a CSS
stylesheet and can format different elements, but having trouble formatting
the asp.net controls , such as dropdownlist.

Thanks

Neil


May 15 '06 #2
<script language="VB" runat="server">
Sub Page_Load(ByVal Src As Object, ByVal E As EventArgs)
Dim MyStyle As New Style
MyStyle.BackColor = Drawing.Color.Aqua
DropDownList1.ApplyStyle(MyStyle)
End Sub
</script>

Not all properties can be changed, though.

Also, see the source code for a custom web control written by Fabrice Marguerie :
http://weblogs.asp.net/fmarguerie/ar...2/27/3103.aspx

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neil Steventon" <Ne***********@discussions.microsoft.com> wrote in message
news:13**********************************@microsof t.com...
Is there a problem with asp.net 2 when setting the Csstyle. I have a CSS
stylesheet and can format different elements, but having trouble formatting
the asp.net controls , such as dropdownlist.

Thanks

Neil



May 15 '06 #3
<script language="VB" runat="server">
Sub Page_Load(ByVal Src As Object, ByVal E As EventArgs)
Dim MyStyle As New Style
MyStyle.BackColor = Drawing.Color.Aqua
DropDownList1.ApplyStyle(MyStyle)
End Sub
</script>

Not all properties can be changed, though.

Also, see the source code for a custom web control written by Fabrice Marguerie :
http://weblogs.asp.net/fmarguerie/ar...2/27/3103.aspx

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neil Steventon" <Ne***********@discussions.microsoft.com> wrote in message
news:13**********************************@microsof t.com...
Is there a problem with asp.net 2 when setting the Csstyle. I have a CSS
stylesheet and can format different elements, but having trouble formatting
the asp.net controls , such as dropdownlist.

Thanks

Neil


May 15 '06 #4
Believe me, I only posted this message once.

;-)

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:Or**************@TK2MSFTNGP02.phx.gbl...
<script language="VB" runat="server">
Sub Page_Load(ByVal Src As Object, ByVal E As EventArgs)
Dim MyStyle As New Style
MyStyle.BackColor = Drawing.Color.Aqua
DropDownList1.ApplyStyle(MyStyle)
End Sub
</script>

Not all properties can be changed, though.

Also, see the source code for a custom web control written by Fabrice Marguerie :
http://weblogs.asp.net/fmarguerie/ar...2/27/3103.aspx

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neil Steventon" <Ne***********@discussions.microsoft.com> wrote in message
news:13**********************************@microsof t.com...
Is there a problem with asp.net 2 when setting the Csstyle. I have a CSS
stylesheet and can format different elements, but having trouble formatting
the asp.net controls , such as dropdownlist.

Thanks

Neil


May 15 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jaz | last post by:
Is there a reason why IE wont apply styles on table cells? Either I shouldn't do this, I've got an error somewhere, or IE has a bug or doesn't support it. (Opera and Moz render okay) Since I've...
1
by: Steve Pugh | last post by:
I have some styles which IE (Win - tested in 5, 5.5 and 6) is only applying to the first letter of the element. Basic stuff like font-weight and font-size applied to a <p> or <hx> element via...
3
by: Armand Karlsen | last post by:
Is it possible to apply the same styling code as is used on my web page to a CGI-based hit-counter, where the script is a pre-made one supplied by the ISP? The webpage in question is:...
3
by: Gandalf | last post by:
I wish to apply different styles to items in a DropDownList. However, any styles applied in the codebehind (using the ListItem.Addtributes property) do not get rendered. This is an old question but...
7
by: sasquatch | last post by:
Hi, I've a a site with nested master pages and content pages. I tried using a theme with a stylesheet in the app_themes directory referencing it in the web.config file from a pages tag theme...
2
by: luke.crouch | last post by:
My server-side php script is generating an xml response with the following structure: <thread class='Columns'> <Id class='Column dataDetail'>12345</Id> <Command class='Column...
2
by: viveklinux | last post by:
Hi, Have a FAQ page , where have many sets of questions and answers. The questions need to be a different colour / style and the answers different. Was wondering is there a easy way to do this...
5
by: Dinsdale | last post by:
Without using CSS styles or linked stylesheets, I need to apply formatting to text links that use rollover effects. I can NOT get the underline to show using this technique: <A...
8
by: Mort Strom | last post by:
Right now the header of my master page contains all of the CSS styles for all of the pages that might be loaded in my ContentPlaceHolder. The problem is that my <styletag is getting too large to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.