使用回调技术实现局部刷新,它只要是实现了ICallbackEventHandler这个接口,使用接口中的RaiseCallbackEvent
事件和GetCallbackResult()方法,最后用javaScript脚本来调用
以下是前台Default.aspx.cs代码:
1
using System;
2
using System.Data;
3
using System.Configuration;
4
using System.Collections;
5
using System.Web;
6
using System.Web.Security;
7
using System.Web.UI;
8
using System.Web.UI.WebControls;
9
using System.Web.UI.WebControls.WebParts;
10
using System.Web.UI.HtmlControls;
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
以下是后台Default.aspx代码:
1
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="February_AJAX_Default" %>
2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5
<html xmlns="http://www.w3.org/1999/xhtml" >
6
<head runat="server">
7
<title>无标题页</title>
8
<script type="text/javascript">
9
function FillData()
10
2
3
4
5
6
7
8
9
10