Asp.Net2.0之不刷新客户端回调 直接使用NET自带的ajaxUPDATEPANEL,然后平时该怎么写就怎么写,它自动实现不刷新回调。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 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 SubEnd Class AJAX,不需要你控制,自然就是不刷新实现回调 GridView+CheckBox实现全选反选删除 站内数据库的搜索引擎谁做过? 创建表,并且设置ID 为主键,怎么写? 怎样才能实现快速生成数据页?请指教谢谢 请问什么叫bs架构? 如何在对一Table进行增加行,插入行,删除行!来者有分! 我的msn在win2003下怎么登录不上? asp.net 模块开发 怎样判断同一时间或者是同一IP,同样的内容不允许提交?? 请各位大侠说说Asp.net的后台编码和混合编码的区别以及各自的特点 asp.net连接mysql数据库关于ODBC的若干问题 该页正在访问其控制范围之外的信息.有些危险.是否继续.怎么回事?
<%@ 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