<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<>">
<html xmlns="<>" >
<head>
<title>统计动态页面访问量的几种方法</title>
</head>
<body>
这是在层中显示
<div id="pv"></div>
<script src="AddNumber.aspx"></script>
</body>
</html>
累加页面 AddNumber.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AddNumber.aspx.cs" Inherits="AddNumber" %>
AddNumber.aspx.cs
代码
1 public partial class AddNumber : System.Web.UI.Page
2 {
3 private static int count = 1;
4 protected void Page_Load(object sender, EventArgs e)
5 {
6 count++;
7 Response.Write("var pv=document.getElementById('pv'); pv.innerText=" + count + ";");
8 }
9 }