By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,389 Members | 1,989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,389 IT Pros & Developers. It's quick & easy.

Applying CSS Styles to Dropdownlist

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
<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

P: n/a
<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

P: n/a
<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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.