<%@ Page Language="VB" %>
<%@ OutputCache Duration="120" VaryByParam="none" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        ltrTime.Text = DateTime.Now  ' 現在時刻を表示（Labelコントロールに出力）
    End Sub

    Protected Shared Function GetCurrent(ByVal context As HttpContext) As String
        Return DateTime.Now  ' 現在時刻を返す（Substitutionコントロールに出力）
    End Function
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Substitutionコントロール</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Literal ID="ltrTime" runat="server"></asp:Literal><br />
        <asp:Substitution ID="subTime" runat="server" MethodName="GetCurrent" />
        &nbsp;</div>
    </form>
</body>
</html>
