Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ajax °²È«ÐÔ

ÍêÈ«ÊÊÓÃASP.NETµÄÈÏÖ¤»úÖÆ
–¿ÉÒÔʹÓÃFormsAuthentication
•WebService·½·¨¿ÉÒÔ²Ù×÷Cookie
–Impersonation
–PrincipalPermission
WebService7.cs Code
using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Script.Services;
/// <summary>
/// WebService7 µÄժҪ˵Ã÷
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ScriptService]
public class WebService7 : System.Web.Services.WebService {
public WebService7 () {
//Èç¹ûʹÓÃÉè¼ÆµÄ×é¼þ£¬ÇëÈ¡Ïû×¢ÊÍÒÔÏÂÐÐ
//InitializeComponent();
}
[WebMethod]
public string HelloWorld() {
if (!HttpContext.Current.User.Identity.IsAuthenticated)
{
throw new ApplicationException("please Login In");
}
return "Hello "+HttpContext.Current.User.Identity.Name;
}

}
Default8.aspx Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default8.aspx.cs" Inherits="Default8" %>
<!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>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat=server ID="aaa" ScriptMode=Debug>
<Services>
<asp:ServiceReference Path="WebService7.asmx" />
</Services>
</asp:ScriptManager>
<mce:script language=javascript type="text/javascript"><!--
function GetMessage()
{
WebService7.HelloWorld(getresult);
}
function getresult(result)
{
alert(result);
}

// --></mce:script>
<input id="Button1" type="button" value="button" on


Ïà¹ØÎĵµ£º

ASP.NET AJAX ʵÏֵǽÎÞË¢ÐÂ/¶¯Ì¬Ìí¼Ó·þÎñÆ÷¿Ø¼þ

ÔÚ×î½ü¿ªÊ¼½«AJAX¼¼Êõ¼ÓÈëµ½ÈÕ³£µÄ¿ª·¢¹¤×÷ÖС£ÎÒÔÚ×î½üдÁ˸öAJAXµÄÎÞˢеǽÇÒ¶¯Ì¬Ìí¼Ó·þÎñÆ÷¿Ø¼þµÄ¹¤×÷£¬ÎÒ½«´Ë¹¦ÄܸæËß´ó¼ÒÏ£Íû¶Ô´ó¼ÒµÄ¹¤×÷ÓÐËù°ïÖú¡£Èç¹û´ó¼ÒÓиüºÃµÄ·½·¨ÇÒÔ¸ÒâÔÚ´ËÁôÑÔÈÃÎÒÒ²¿ÉÒÔ·ÖÏíµ½ÄãµÄ³É¹û¡£
Ê×ÏÈÔÚÒ³ÃæÖеÄHTML±ê¼ÇÖмÓÈë¿Ø¼þUpdatePanelºÍÁ½¸öTextboxÒ»¸öButton£º
<asp:UpdatePanel ID ......

jquery¡¢Ajax¡¢strutsµÄ¼¯³É

Html´úÂ룺
<%@ page language="java" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>jquery ajax</title>
  <link rel="stylesheet" type="text/css" media="screen"
  ......

AJAX¼¼ÊõÈëÃÅÖ¸µ¼

ʲôÊÇ AJAX?
¡¡¡¡AJAX (Òì²½ JavaScript ºÍ XML) ÊǸöвúÉúµÄÊõÓï,רΪÃèÊöJavaScriptµÄÁ½ÏîÇ¿´óÐÔÄÜ.ÕâÁ½ÏîÐÔÄÜÔÚ¶àÄêÀ´Ò»Ö±±»ÍøÂ翪·¢ÕßËùºöÂÔ,Ö±µ½×î½üGmail, Google suggestºÍgoogle MapsµÄºá¿Õ³öÊÀ²ÅʹÈËÃÇ¿ªÊ¼Òâʶµ½ÆäÖØÒªÐÔ.
¡¡¡¡ÕâÁ½Ïî±»ºöÊÓµÄÐÔÄÜÊÇ:
¡¡¡¡ÎÞÐèÖØÐÂ×°ÔØÕû¸öÒ³Ãæ±ãÄÜÏò·þÎñÆ÷·¢ËÍÇëÇó.
¡¡¡ ......

Ajax add_beginRequest

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!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=" ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ