<%@ Page Language="vb" %>
<html>
<head>
<title>Init event example</title>
<script runat="server">
Dim TheColor As System.Drawing.Color
Sub Page_Init()
TheColor = System.Drawing.Color.Red
End Sub
Sub Page_Load()
Message.ForeColor = TheColor
Message.Text = "The color of this text was set in Page_Init."
TheColor = System.Drawing.Color.Blue
Message2.ForeColor = TheColor
Message2.Text = "The color of this text was set in Page_Load."
End Sub
</script>
</head>
<body>
<asp:label id="Message" runat="server"/>
<br/>
<asp:label id="Message2" runat="server"/>
</body>
</html>
|