建两个页面:
Default.aspx
前台:
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %><!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 runat="server">
    <title>无标题页</title>
    <script type="text/javascript"> var s = null; 
var xmlHttp ;
function aa() 

try 

if(window.ActiveXObject)
{
xmlHttp= new ActiveXObject("Microsoft.XMLHTTP"); 
}
else if(window.XMLHttpRequest)
{
xmlHttp=new XMLHttpRequest;
}
xmlHttp.open("GET","Default2.aspx",true); 
xmlHttp.send(null); xmlHttp.onreadystatechange=function() 

if(xmlHttp.readyState==4 || xmlHttp.readyState=='complete') 

if(xmlHttp.status  ==  200) 
{ alert("wwww"  +  xmlHttp.responseText); }else 

alert(xmlHttp.readyState+'no'); 


clearInterval(s); } 

catch(e) 

alert('错误' + e.message + '发生在' +    e.lineNumber + '行'); 

} function loadthis() 

s= setInterval(aa,1000); 
} </script> </head>
<body  onload="loadthis()">
    <form id="form1" runat="server" >
    <div>
    
    </div>
    </form>
</body>
</html>
Default2.aspx
前台:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
后台:
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;public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Write("我是一只小菜鸟");
        Response.End();
    }
}