indexWithInit.aspx 769 B

123456789101112131415161718192021222324252627282930313233
  1. <%@ Page Language="C#" Theme="Green" %>
  2. <head id="foo" runat="server">
  3. <script runat="server">
  4. protected override void OnInit (EventArgs args)
  5. {
  6. base.OnInit (args);
  7. }
  8. void Page_Load ()
  9. {
  10. string s = String.Format ("{0} controls", Header.Controls.Count);
  11. foreach (Control c in Header.Controls) {
  12. s = s + String.Format (", {0}", c.GetType());
  13. }
  14. fweep.Text = s;
  15. }
  16. </script>
  17. </head>
  18. <form runat="server">
  19. <asp:Label runat="server" id="label" Text="Label"/>
  20. <asp:Button runat="server" id="button" Text="Button"/>
  21. <br/>
  22. <asp:radiobuttonlist runat="server">
  23. <asp:ListItem Value="4" Text="Four"/>
  24. <asp:ListItem Value="5" Text="Five"/>
  25. <asp:ListItem Value="6" Text="Six"/>
  26. </asp:radiobuttonlist>
  27. <asp:label id="fweep" runat="server"></asp:label>
  28. </form>