|
静态页面 staticHtml.html
<!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>统计动态页面访问量的几种方法</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
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Drawing; public partial class AddNumber : System.Web.UI.Page { private static int count = 1; protected void Page_Load(object sender, EventArgs e) { count++; Response.Write("var pv=document.getElementById('pv'); pv.innerText=" + count + ";"); } }
|
一共有 3 条评论
03?05?08?
我怎么实现不了?