How to use Substitution Control with Caching in asp.net

asp.net Substitution and Caching example: how to use Substitution Control
SubstitutionExample.aspx

<%@ Page Language="C#" %>
<!-<%@ OutputCache Duration="300" VaryByParam="none" %>-->

<!DOCTYPE html>

<script runat="server">
    static string myRandomNumber(HttpContext context) {
        int myNumber = new System.Random().Next(100, 500);
        return myNumber.ToString();
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>asp.net Substitution and Caching example: how to use Substitution Control</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h1 style="color:Fuchsia">Substitution Example</h1>
        <asp:Label ID="Label1" runat="server"></asp:Label>
        Page Cached Time:
        <h2 style="color:Teal">
            <%= DateTime.Now.ToLongTimeString() %>
        </h2>
        Current Time:
        <h2 style="color:Navy">
            <%= DateTime.Now.ToLongTimeString() %>
        </h2>
        <hr />
        Substitition Control Zone [Random Number]
        <h1 style="color:Red">
            <asp:Substitution ID="Substitution1" runat="server" MethodName="myRandomNumber" />
        </h1>
    </div>
    </form>
</body>
</html>
More asp.net example