HTMLServerControlFormat.aspx
- <%@ Page Language="C#" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <script runat="server">
- protected void Button1_Click(object sender, System.EventArgs e) {
- Div1.Style["Color"] = "White";
- Div1.InnerText = "Division Changed";
- Div1.Style["height"] = "250px";
- Div1.Style["width"] = "250px";
- Div1.Style["background-color"] = "Crimson";
- Div1.Style["border-style"] = "double";
- Div1.Style["border-color"] = "HotPink";
- Div1.Style["font-size"] = "large";
- Div1.Style["text-align"] = "center";
- }
- </script>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title>asp.net HTML server control example: how to format (design and style) programmatically</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <h2 style="color:Teal">HTML server control example: Design and Style</h2>
- <div id="Div1" runat="server">
- Hi this is a HTML server control: Div
- </div>
- <br />
- <asp:Button
- runat="server"
- Text="Format the Division"
- OnClick="Button1_Click"
- Font-Bold="true"
- ForeColor="Green"
- />
- </div>
- </form>
- </body>
- </html>
0 comments:
Post a Comment