Forum Moderators: open
========================
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<script runat="server" language="vbscript">
Sub Page_load(sender As Object, e As EventArgs)
timelabel.Text = DateTime.Now.ToString()
End Sub
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
Hello There !<br />
The Time now is <asp:Label runat="server" id="timelabel" />
</form>
</body>
</html>
=======================
The Output
=======================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
Untitled Page
</title></head>
<body>
Hello There !<br />
The Time now is <span id="timelabel"></span>
</form>
</body>
</html>
Your missing part of the event handler
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Visual Studio's ability to auto generate your page events is a nice feature of the IDE. Selecting (Page Events) and an event in the code behind page, will generate the handler for you.
[edited by: Response at 1:57 pm (utc) on Mar. 11, 2008]