<%@ Page Language="C#" %>

 

<!DOCTYPE html>

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

    <title>Example: No CodeBehind</title>

    <script language="C#" runat="server">

        int count = 0;

       

        void Page_Load()

        {

            if (!IsPostBack)    // first page load

            {

                lblHeading.Text = "ASPX Page with No CodeBehind";

                Session["Count"] = count;

            }

            else                // page postback

            {

                count = (int)Session["Count"];

                count = count + 1;

                Session["Count"] = count;

            }

        }

    </script>

 

</head>

<body bgcolor="#9999ff">

    <form id="form1" runat="server">

    <div>

        <asp:Label ID="lblHeading" runat="server" Font-Bold="True" Font-Size="24pt"></asp:Label>

        <br />

        <br />

        <div id="dvDisplay">You clicked the button <%=count %> times.</div>

        <br />

        <br />

        <input id="btnSubmit" value="Process" type="submit" />

    </div>

    </form>

</body>

</html>