Mega Code Archive

 
Categories / ASP.Net / Asp Control
 

Set Label style (VB net)

<%@ Page Language="vb" %> <html> <head>    <title>Control Properties Example</title>    <script runat="server">       Sub Page_Load()          Label2.Style("background-color") = "silver"       End Sub    </script>    <style>        .Hello           {             font: 14pt arial;             color:blue;        }    </style> </head> <body>    <h1>Control Properties Example</h1>    <form runat="server">       <asp:table id="MyTable" border="1" cellpadding="5" cellspacing="0" runat="server">          <asp:tablerow runat="server">             <asp:tablecell runat="server">                HtmlInputText Control:             </asp:tablecell>             <asp:tablecell runat="server">                <input id="Text1" type="text"                    style="font: 12pt arial; background-color:silver; color:red;"                    runat="server"/>             </asp:tablecell>          </asp:tablerow>          <asp:tablerow runat="server">             <asp:tablecell runat="server">                Label with Style:             </asp:tablecell>             <asp:tablecell runat="server">                <asp:label id="Label2" cssclass="Hello" runat="server">                   Hello, World!                </asp:label>             </asp:tablecell>          </asp:tablerow>       </asp:table>    </form> </body> </html>