When I say dynamic I mean things like button rollovers, etc.<BR><BR>I'm trying to figure out how to do this ALL in asp.net. I already know how to use vbscript code to do this but as I'm sure you all know I would much rather use 100% asp.net code because of browser compatability.<BR><BR>someone showed me how to do this a few days ago:<BR><BR><script runat="server"><BR>Sub page_load(obj as Object, e as EventArgs)<BR> btnSubmit.Attributes.Add("onmouseover","this.style.backgroundColor='#3366cc';this.style.co lor='#ffff99';this.style.borderStyle='Inset';this. style.borderWidth='';this.style.FontStyle='Annifon t';")<BR> btnSubmit.Attributes.Add("onmouseout","this.style.backgroundColor='#336699';this.style.co lor='orange';this.style.borderStyle='Outset';this. style.borderWidth=''")<BR>End Sub<BR></script><BR><BR><BR>It works, I love it! However, I can't find ANY documentation ANYWHERE on this method. I would like to apply this also to things like hyperlinks, changing the background color of listboxes, all sorts of other stuff - but I can't find any info on it. So any help with this "Attributes.Add" method would be greatly appreciated! Thx!<BR>That's about it dude, what more so you need to know?<BR>From the MSDN Library:<BR><BR> .NET Framework Class Library <BR><BR>AttributeCollection.Add Method [Visual Basic]See Also<BR>AttributeCollection Class | AttributeCollection Members | System.Web.UI Namespace | HtmlControl.Attributes | WebControl.Attributes <BR>Requirements<BR>Platforms: Windows 2000, Windows XP Professional, Windows .NET Server family<BR>Language<BR>C#<BR><BR>C++<BR><BR>JScript<BR><BR>Visual Basic<BR><BR>Show All<BR>Adds an attribute to a server contol's AttributeCollection object.<BR><BR>[Visual Basic]<BR>Public Sub Add( _<BR> ByVal key As String, _<BR> ByVal value As String _<BR>)<BR>[C#]<BR>public void Add(<BR> string key,<BR> string value<BR>);<BR>[C++]<BR>public: void Add(<BR> String* key,<BR> String* value<BR>);<BR>[JScript]<BR>public function Add(<BR> key : String,<BR> value : String<BR>);<BR>Parameters<BR>key <BR>The index assigned to the new attribute in the collection. <BR>value <BR>The attribute to store in the collection. <BR>Example<BR>[Visual Basic, C#, JScript] The following example demonstrates how to use the Add method to add an attribute to an server control's AttributeCollection object programmatically.<BR><BR>[Visual Basic] <BR><html><BR> <script language="VB" runat="server"><BR> Sub SubmitBtn_Click(Src As Object, e As EventArgs)<BR> FirstSelect.Attributes.Add("Multiple", "True")<BR> End Sub<BR> </script><BR> <body><BR> <form runat="server"><BR> <span id="Message" MaintainState="false" runat="server" /><BR> <p><BR> Make a selection:<BR> <select id="FirstSelect" padding="1" width="40" style="font: 16pt verdana;background-color:lightblue;color:black;" runat="server"><BR> <option>This</option><BR> <option>That</option><BR> <option>Other</option><BR> </select><BR><BR><BR><BR> <input type="submit" id="SubmitBtn" OnServerClick="SubmitBtn_Click" runat="server"/><BR><BR> </form><BR> </body><BR> </html><BR>[C#] <BR><html><BR> <script language="C#" runat="server"><BR> void SubmitBtn_Click(Object Src, EventArgs e){<BR> FirstSelect.Attributes.Add("Multiple", <BR> "True");<BR> }<BR> </script><BR> <body><BR> <form runat="server"><BR> <span id="Message" MaintainState="false" runat="server" /><BR> <p><BR> Make a selection:<BR> <select id="FirstSelect" padding="1" width="40" style="font: 16pt verdana;background-color:lightblue;color:black;" runat="server"><BR> <option>This</option><BR> <option>That</option><BR> <option>Other</option><BR> </select><BR><BR><BR><BR> <input type="submit" id="SubmitBtn" OnServerClick="SubmitBtn_Click" runat="server"/><BR><BR> </form><BR> </body><BR> </html><BR>[JScript] <BR><html><BR> <script language="JScript" runat="server"><BR> function SubmitBtn_Click(Src, e : EventArgs){<BR> FirstSelect.Attributes.Add("Multiple", <BR> "True");<BR> }<BR> </script><BR> <body><BR> <form runat="server"><BR> <span id="Message" MaintainState="false" runat="server" /><BR> <p><BR> Make a selection:<BR> <select id="FirstSelect" padding="1" width="40" style="font: 16pt verdana;background-color:lightblue;color:black;" runat="server"><BR> <option>This</option><BR> <option>That</option><BR> <option>Other</option><BR> </select><BR><BR><BR><BR> <input type="submit" id="SubmitBtn" OnServerClick="SubmitBtn_Click" runat="server"/><BR><BR> </form><BR> </body><BR> </html><BR>[C++] No example is available for C++. To view a Visual Basic, C#, or JScript example, click the Language Filter button in the upper-left corner of the page.<BR><BR>Requirements<BR>Platforms: Windows 2000, Windows XP Professional, Windows .NET Server family<BR><BR>See Also<BR>AttributeCollection Class | AttributeCollection Members | System.Web.UI Namespace | HtmlControl.Attributes | WebControl.Attributes <BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>Send comments on this topic. <BR><BR>? 2001 Microsoft Corporation. All rights reserved. <BR><BR>thx Chris,<BR><BR>I guess I'm not understanding the syntax.. <BR><BR>If you compare<BR><BR>btnSubmit.Attributes.Add("onmouseover","this.style.backgroundColor='#3366cc';this.style.co lor='#ffff99';this.style.borderStyle='Inset';this. style.borderWidth='';this.style.FontStyle='Annifon t';")<BR><BR>to<BR><BR>FirstSelect.Attributes.Add("Multiple", "True")<BR><BR>In the button rollover it is more like this btnSubmit.Attribute.Add(***EVENT****, ***ATTRIBUTE(S) TO BE CHANGED***)<BR><BR>where as with the listbox I really don't understand..I guess there is no event really in this one, it just instead adds the "Multiple" property as the selectmode and I'm not really sure what "True" is doing?? I mean here is how Microsoft explains it:<BR><BR>[Visual Basic]<BR>Public Sub Add( _<BR> ByVal key As String, _<BR> ByVal value As String _<BR>)<BR><BR>Parameters<BR>key <BR>The index assigned to the new attribute in the collection. <BR>value <BR>The attribute to store in the collection. <BR><BR>Looking at their example and then looking at that, I just don't understand it.. Sorry for such dumb questions, I'm not a programmer by day!! Thx again =)<BR>The simple and important part is:<BR><BR>"The Attributes collection contains a collection of all attributes declared in the opening tag of a Web server control. This allows you to programmatically control the attributes associated with a Web server control. You can add attributes to the collection or remove attributes from the collection."<BR><BR>So, anything that can be declared in an opening tag of an element can be added to or removed from the attributes collection. Properties and Events fall into this category. For your button, you are adding the onMouseOver event to the attributes collecton. For the ListBox example, a property, Multiple, is being added and set to True. This may confuse you because plain HTML just uses "Multiple", whith no value - it assumes "True". You could, however use the syntax: Multiple="True" and it would function the same.<BR><BR>I hope this clears it up some.I think I understand now, thanks!! =)<BR><BR>I'm having some problems with using the method now however.<BR><BR><BR><%@ Page Language="VB" %><BR><%@ Import Namespace="System.Drawing" %><BR><BR><script runat="server"><BR>Sub page_load(obj as Object, e as EventArgs)<BR>lbMenu.Attributes.Add("Multiple","True")<BR>lbMenu.Attributes.Add("BackColor","Red")<BR>lbMenu.Attributes.Add("Rows","2")<BR>End Sub<BR></script><BR><BR><BR><html><BR><body><BR><BR><asp:ListBox id="lbMenu" runat="server"><BR><asp:Listitem>Red</asp:Listitem><BR><asp:Listitem>Blue</asp:Listitem><BR><asp:Listitem>Green</asp:Listitem><BR><asp:Listitem>White</asp:Listitem><BR><asp:Listitem>Orange</asp:Listitem><BR></asp:ListBox><BR><BR></body><BR></html><BR><BR>The only one that works is the selectmode. I can't get the color or rows property to set. Any ideas?