ajax,xml数据岛实现无刷新

ExpandedBlockStart.gif ContractedBlock.gif <% dot.gif @ Page Language="C#" AutoEventWireup="true" CodeFile="View.aspx.cs" Inherits="View"  %>
None.gif
None.gif
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
None.gif
None.gif
< html  xmlns ="http://www.w3.org/1999/xhtml"   >
None.gif
< head  runat ="server" >
None.gif    
< title > 无标题页 </ title >
None.gif    
ExpandedBlockStart.gifContractedBlock.gif
< script  type ="text/javascript" > dot.gif
InBlock.gif     
function CallServer()
ExpandedSubBlockStart.gifContractedSubBlock.gif      
dot.gif{
InBlock.gif          
var product = "DFDF";
InBlock.gif          
<%= ClientScript.GetCallbackEventReference(this"product""ReceiveServerData",null)%>;
InBlock.gif          
ExpandedSubBlockEnd.gif      }

InBlock.gif      
InBlock.gif      
function ReceiveServerData(Value)
ExpandedSubBlockStart.gifContractedSubBlock.gif      
dot.gif{
InBlock.gif         document.all.oDataPanel.innerHTML 
= '<xml id="xmlData">'+ Value +'</xml>';
InBlock.gif         
ExpandedBlockEnd.gif     }

None.gif
</ script >
None.gif
</ head >
None.gif
< body >
None.gif
< input  id ="Button1"  onclick ="CallServer()"  type ="button"  value ="Call to Server"   />  
None.gifsfd
None.gif    
< form  id ="form1"  runat ="server" >
None.gif      
< div >
None.gif    
None.gif
< table  width ="400"  border ="0"  cellpadding ="0"  cellspacing ="1"  DATAPAGESIZE ="20"  bgcolor ="#CCCCCC"  id ="datatable"  datasrc ="#xmlData" >
None.gif
< tr >
None.gif  
< td  bgcolor ="#FFFFFF"  style =" font-size:12px" >< span  datafld ="id" ></ span ></ td >
None.gif  
< td  bgcolor ="#FFFFFF"  style =" font-size:12px" >< span  datafld ="djh" ></ span ></ td >
None.gif  
< td  bgcolor ="#FFFFFF"  style =" font-size:12px" >< span  datafld ="rq" ></ span ></ td >
None.gif
</ tr >
None.gif
</ table >
None.gif    
</ div >
None.gif    
< div  id ="oDataPanel" >
None.gif    
</ div >
None.gif        
None.gif    
</ form >
None.gif   
None.gif
</ body >
None.gif
</ html >

View.aspx

None.gif using  System;
None.gif
using  System.Data;
None.gif
using  System.Configuration;
None.gif
using  System.Collections;
None.gif
using  System.Web;
None.gif
using  System.Web.Security;
None.gif
using  System.Web.UI;
None.gif
using  System.Web.UI.WebControls;
None.gif
using  System.Web.UI.WebControls.WebParts;
None.gif
using  System.Web.UI.HtmlControls;
None.gif
None.gif
public  partial  class  View : System.Web.UI.Page, ICallbackEventHandler
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif    
private string CallBackValue = string.Empty;
InBlock.gif    ClassData MyClass 
= new ClassData();
InBlock.gif    
protected void Page_Load(object sender, EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif
ExpandedSubBlockEnd.gif    }

InBlock.gif    
string ICallbackEventHandler.GetCallbackResult()
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        DataSet _DS 
= MyClass.ExecDs("select top 10  from table ""table ");
InBlock.gif        
return _DS.GetXml();
InBlock.gif
ExpandedSubBlockEnd.gif    }

InBlock.gif    
void ICallbackEventHandler.RaiseCallbackEvent(string eventArgument)
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        
this.CallBackValue = eventArgument;
ExpandedSubBlockEnd.gif    }

ExpandedBlockEnd.gif}

None.gif

View.cs

转载于:https://www.cnblogs.com/nuowei08/archive/2006/11/07/553444.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值