直接使用NET自带的ajax
UPDATEPANEL,然后平时该怎么写就怎么写,它自动实现不刷新回调。

解决方案 »

  1.   

    default.aspx
    <%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <script type="text/javascript"  >
    var XmlHttp;function createXmlHttpRequest(){
        if(window.ActiveXObject){
            XmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }else if(window.XMLHttpRequest){
            XmlHttp=new XMLHttpRequest();
        }
    }function getservertext(){
    createXmlHttpRequest();
    XmlHttp.onreadystatechange=showmessage;
    XmlHttp.open("GET","ajaxres1.aspx",true);
    XmlHttp.send(null);
    }function showmessage(){
        if(XmlHttp.readyState==4){
            if(XmlHttp.status==200){
                var obj;
                obj=document.getElementById("maindiv");
                obj.innerHTML=XmlHttp.responseText;
            }
        }
    }</script>
    <body>    <form id="form1" runat="server">
        <div id="maindiv"></div>
            <input type="button" id="button1" value="button1" onclick="getservertext();" />
        </form>
    </body>
    </html>ajaxres1.aspx的内容:
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="ajaxres1.aspx.vb" Inherits="ajaxres1" %>ajaxres1.aspx.vb的内容:
    Partial Class ajaxres1
        Inherits System.Web.UI.Page    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
             Response.Write("Hello Ajax!")
        End Sub
    End Class
      

  2.   

    AJAX,不需要你控制,自然就是不刷新实现回调