Permalink
Browse files

Move to old-code

svn path=/old-code/; revision=156234
  • Loading branch information...
1 parent 87b5449 commit 49c1f52292d0a28b55e05e1dd8abdb4e527488ff @migueldeicaza migueldeicaza committed Apr 27, 2010
@@ -0,0 +1,44 @@
+<%@ Page Language="C#" %>
+
+
+<html>
+<body>
+
+ <h3><font face="verdana">Applying Styles to HTML Controls</font></h3>
+
+ <p><font face="verdana"><h4>Styled Span</h4></font><p>
+
+ <span style="font: 12pt verdana; color:orange;font-weight:700" runat="server">
+ This is some literal text inside a styled span control
+ </span>
+
+ <p><font face="verdana"><h4>Styled Button</h4></font><p>
+
+ <button style="font: 8pt verdana;background-color:lightgreen;border-color:black;width:100" runat="server">Click me!</button>
+
+ <p><font face="verdana"><h4>Styled Text Input</h4></font><p>
+
+ Enter some text: <p>
+ <input type="text" value="One, Two, Three" style="font: 14pt verdana;background-color:yellow;border-style:dashed;border-color:red;width:300;" runat="server"/>
+
+ <p><font face="verdana"><h4>Styled Select Input</h4></font><p>
+
+ Select an item: <p>
+ <select style="font: 14pt verdana;background-color:lightblue;color:purple;" runat="server">
+ <option>Item 1</option>
+ <option>Item 2</option>
+ <option>Item 3</option>
+ </select>
+
+ <p><font face="verdana"><h4>Styled Radio Buttons</h4></font><p>
+
+ Select an option: <p>
+ <span style="font: 16 pt verdana;font-weight:300">
+ <input type="radio" name="Mode" checked style="width:50;background-color:red;zoom:200%" runat="server"/>Option 1<br>
+ <input type="radio" name="Mode" style="width:50;background-color:red;zoom:200%" runat="server"/>Option 2<br>
+ <input type="radio" name="Mode" style="width:50;background-color:red;zoom:200%" runat="server"/>Option 3
+ </span>
+
+</body>
+</html>
+
@@ -0,0 +1,92 @@
+<html>
+
+<script language="C#" runat="server">
+
+ void Page_Load(Object Src, EventArgs E ) {
+
+ Message.InnerHtml += "<h5>Accessing Styles...</h5>";
+
+ Message.InnerHtml += "The color of the span is: " + MySpan.Style["color"] + "<br>";
+ Message.InnerHtml += "The width of the textbox is: " + MyText.Style["width"] + "<p>";
+
+ Message.InnerHtml += "MySelect's style collection is: <br>";
+
+ IEnumerator keys = MySelect.Style.Keys.GetEnumerator();
+
+ while (keys.MoveNext()) {
+
+ String key = (String)keys.Current;
+ Message.InnerHtml += "<img src='/quickstart/images/bullet.gif'>&nbsp;&nbsp;";
+ Message.InnerHtml += key + "=" + MySelect.Style[key] + "<br>";
+ }
+ }
+
+ void Submit_Click(Object Src, EventArgs E ) {
+
+ Message.InnerHtml += "<h5>Modifying Styles...</h5>";
+
+ MySpan.Style["color"] = ColorSelect.Value;
+ MyText.Style["width"] = "600";
+
+ Message.InnerHtml += "The color of the span is: " + MySpan.Style["color"] + "<br>";
+ Message.InnerHtml += "The width of the textbox is: " + MyText.Style["width"];
+ }
+
+</script>
+
+<body>
+
+ <form runat="server">
+
+ <h3><font face="verdana">Programmatically Accessing Styles</font></h3>
+
+ <div style="font: 8pt verdana;background-color:cccccc;border-color:black;border-width:1;border-style:solid;padding:1,10,25,10">
+ <span id="Message" EnableViewState="false" runat="server"/>
+ <p>
+ Select a color for the span: <p>
+ <select id="ColorSelect" style="font: 11pt verdana;font-weight:700;" runat="server">
+ <option selected="selected">red</option>
+ <option>green</option>
+ <option>blue</option>
+ </select>
+ <input type="submit" runat="server" Value="Change Style" OnServerClick="Submit_Click">
+ </div>
+
+ <p><font face="verdana"><h4>Styled Span</h4></font><p>
+
+ <span id="MySpan" style="font: 12pt verdana; color:orange;font-weight:700" runat="server">
+ This is some literal text inside a styled span control
+ </span>
+
+ <p><font face="verdana"><h4>Styled Button</h4></font><p>
+
+ <button id="MyButton" style="font: 8pt verdana;background-color:lightgreen;border-color:black;width:100" runat="server">Click me!</button>
+
+ <p><font face="verdana"><h4>Styled Text Input</h4></font><p>
+
+ Enter some text: <p>
+ <input id="MyText" type="text" value="One, Two, Three" style="font: 14pt verdana;background-color:yellow;border-style:dashed;border-color:red;width:300;" runat="server"/>
+
+ <p><font face="verdana"><h4>Styled Select Input</h4></font><p>
+
+ Select an item: <p>
+ <select id="MySelect" style="font: 14pt verdana;background-color:lightblue;color:purple;" runat="server">
+ <option>Item 1</option>
+ <option>Item 2</option>
+ <option>Item 3</option>
+ </select>
+
+ <p><font face="verdana"><h4>Styled Radio Buttons</h4></font><p>
+
+ Select an option: <p>
+ <span style="font: 16 pt verdana;font-weight:300">
+ <input id="MyRadio1" type="radio" name="Mode" checked style="width:50;background-color:red;zoom:200%" runat="server"/>Option 1<br>
+ <input id="MyRadio2" type="radio" name="Mode" style="width:50;background-color:red;zoom:200%" runat="server"/>Option 2<br>
+ <input id="MyRadio3" type="radio" name="Mode" style="width:50;background-color:red;zoom:200%" runat="server"/>Option 3
+ </span>
+
+ </form>
+
+</body>
+</html>
+
@@ -0,0 +1,29 @@
+<html>
+
+ <body>
+
+ <h3><font face="Verdana">Declaring Server Controls</font></h3>
+
+ This sample demonstrates how to declare the &lt;asp:label&gt; server control and
+ manipulate its properties within a page.
+
+ <p>
+
+ <hr>
+
+<form runat=server>
+ <asp:label id="Message1" font-size="16" font-bold="true" forecolor="red" runat=server>This is Message One</asp:label>
+
+ <br>
+
+ <asp:label id="Message2" font-size="20" font-italic="true" forecolor="blue" runat=server>This is Message Two</asp:label>
+
+ <br>
+
+ <asp:label id="Message3" font-size="24" font-underline="true" forecolor="green" runat=server>This is Message Three</asp:label>
+</form>
+
+ </body>
+
+</html>
+
@@ -0,0 +1,27 @@
+<html>
+
+ <script language="C#" runat="server">
+
+ void Page_Load(Object Src, EventArgs E) {
+ Message.Text = "You last accessed this page at: " + DateTime.Now;
+ }
+
+ </script>
+
+ <body>
+
+ <h3><font face="Verdana">Manipulating Server Controls</font></h3>
+
+ This sample demonstrates how to manipulate the &lt;asp:label&gt; server control within
+ the Page_Load event to output the current time.
+
+ <p>
+
+ <hr>
+
+ <asp:label id="Message" font-size="24" font-bold="true" runat=server/>
+
+ </body>
+
+</html>
+
@@ -0,0 +1,42 @@
+<html>
+
+ <script language="C#" runat="server">
+
+ void EnterBtn_Click(Object Src, EventArgs E) {
+ Message.Text = "Hi " + Name.Text + ", welcome to ASP.NET!";
+ }
+
+ </script>
+
+ <body>
+
+ <h3><font face="Verdana">Handling Control Action Events</font></h3>
+
+ <p>
+
+ This sample demonstrates how to access a &lt;asp:textbox&gt; server control within the "Click"
+ event of a &lt;asp:button&gt;, and use its content to modify the text of a &lt;asp:label&gt;.
+
+ <p>
+
+ <hr>
+
+ <form action="controls3.aspx" runat=server>
+
+ <font face="Verdana">
+
+ Please enter your name: <asp:textbox id="Name" runat=server/>
+ <asp:button text="Enter" Onclick="EnterBtn_Click" runat=server/>
+
+ <p>
+
+ <asp:label id="Message" runat=server/>
+
+ </font>
+
+ </form>
+
+ </body>
+
+</html>
+
@@ -0,0 +1,111 @@
+<html>
+
+ <script language="C#" runat="server">
+
+ void AddBtn_Click(Object Src, EventArgs E) {
+
+ if (AvailableFonts.SelectedIndex != -1) {
+ InstalledFonts.Items.Add(new ListItem(AvailableFonts.SelectedItem.Value));
+ AvailableFonts.Items.Remove(AvailableFonts.SelectedItem.Value);
+ }
+ }
+
+ void AddAllBtn_Click(Object Src, EventArgs E) {
+
+ while (AvailableFonts.Items.Count != 0) {
+
+ InstalledFonts.Items.Add(new ListItem(AvailableFonts.Items[0].Value));
+ AvailableFonts.Items.Remove(AvailableFonts.Items[0].Value);
+ }
+ }
+
+ void RemoveBtn_Click(Object Src, EventArgs E) {
+
+ if (InstalledFonts.SelectedIndex != -1) {
+
+ AvailableFonts.Items.Add(new ListItem(InstalledFonts.SelectedItem.Value));
+ InstalledFonts.Items.Remove(InstalledFonts.SelectedItem.Value);
+ }
+ }
+
+ void RemoveAllBtn_Click(Object Src, EventArgs E) {
+
+ while (InstalledFonts.Items.Count != 0) {
+
+ AvailableFonts.Items.Add(new ListItem(InstalledFonts.Items[0].Value));
+ InstalledFonts.Items.Remove(InstalledFonts.Items[0].Value);
+ }
+ }
+
+ </script>
+
+ <body>
+
+ <h3><font face="Verdana">Handling Multiple Control Action Events</font></h3>
+
+ <p>
+
+ This sample demonstrates how to handle multiple control action events raised from
+ different &lt;asp:button&gt; controls.
+
+ <p>
+
+ <hr>
+
+ <form action="controls4.aspx" runat=server>
+
+ <table>
+ <tr>
+ <td>
+ Available Fonts
+ </td>
+ <td>
+ <!-- Filler -->
+ </td>
+ <td>
+ Installed Fonts
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <asp:listbox id="AvailableFonts" width="100px" runat=server>
+ <asp:listitem>Roman</asp:listitem>
+ <asp:listitem>Arial Black</asp:listitem>
+ <asp:listitem>Garamond</asp:listitem>
+ <asp:listitem>Somona</asp:listitem>
+ <asp:listitem>Symbol</asp:listitem>
+ </asp:listbox>
+ </td>
+ <td>
+ <!-- Filler -->
+ </td>
+ <td>
+ <asp:listbox id="InstalledFonts" width="100px" runat=server>
+ <asp:listitem>Times</asp:listitem>
+ <asp:listitem>Helvetica</asp:listitem>
+ <asp:listitem>Arial</asp:listitem>
+ </asp:listbox>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <!-- Filler -->
+ </td>
+ <td>
+ <asp:button text="<<" OnClick="RemoveAllBtn_Click" runat=server/>
+ <asp:button text="<" OnClick="RemoveBtn_Click" runat=server/>
+ <asp:button text=">" OnClick="AddBtn_Click" runat=server/>
+ <asp:button text=">>" OnClick="AddAllBtn_Click" runat=server/>
+ </td>
+ <td>
+ <!-- Filler -->
+ </td>
+ </tr>
+ </table>
+
+ </form>
+
+ </body>
+
+</html>
+
Oops, something went wrong.

0 comments on commit 49c1f52

Please sign in to comment.