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

Ajax ¸´ÔÓÊý¾ÝÀàÐÍʹÓûù´¡

¸´ÔÓÊý¾ÝÀàÐÍʹÓûù´¡
•¹«ÓÐÊôÐÔ»ò¹«ÓÐField»á±»ÊͷźͽÓÊÜ
•ÈÝÆ÷¶ÔÏó
–ʵÏÖIList½Ó¿ÚµÄ¶ÔÏó
–ʵÏÖIDictionary½Ó¿ÚµÄ¶ÔÏó
•Key±ØÐëÊÇString
WebService2.cs Code£º
using System;
using System.Collections;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Script.Services;
/// <summary>
///WebService2 µÄժҪ˵Ã÷
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ScriptService]
public class WebService2 : System.Web.Services.WebService {
public WebService2 () {
//Èç¹ûʹÓÃÉè¼ÆµÄ×é¼þ£¬ÇëÈ¡Ïû×¢ÊÍÒÔÏÂÐÐ
//InitializeComponent();
}
[WebMethod]
public Employee HelloWorld(Employee employee) {
employee.salary = employee.salary * 2;
return employee;
}
[WebMethod]
public System.Collections.Generic.List<int> ReList(System.Collections.Generic.List<int> list)
{
list.Reverse();
return list;
}
[WebMethod]
public System.Collections.Generic.IDictionary<string, Employee> GetEmployee()
{
System.Collections.Generic.Dictionary<string, Employee> employee = new System.Collections.Generic.Dictionary<string, Employee>();
Employee employee1 = new Employee();
employee1.fristname = "churen";
employee1.lastname = "youzi";
employee1.salary = 10000;
employee[employee1.fullname] = employee1;
Employee employee2 = new Employee();
employee2.fristname = "youzi";
employee2.lastname = "churen";
employee2.salary = 20000;
employee[employee2.fullname] = employee2;
return employee;

}
}
Default4.aspx Code£º
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default4.aspx.cs" Inherits="Default4" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://ww


Ïà¹ØÎĵµ£º

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

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

Ajax add_initializeRequest

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" 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">
<titl ......

ÓÃC#ץȡAJAXÒ³ÃæµÄÄÚÈÝ

ÏÖÔÚµÄÍøÒ³ÓÐÏ൱һ²¿·ÖÊDzÉÓÃÁËAJAX¼¼Êõ,²»¹ÜÊDzÉÓÃC#ÖеÄWebClient»¹ÊÇHttpRequest¶¼µÃ²»µ½ÕýÈ·µÄ½á¹û,ÒòΪÕâЩ½Å±¾ÊÇÔÚ·þÎñÆ÷·¢ËÍÍê±Ïºó²ÅÖ´ÐеÄ!
µ«ÎÒÃÇÓÃIEä¯ÀÀÒ³ÃæʱÊÇÕý³£µÄ,ËùÒÔ½â¾ö·½·¨Ö»ÓÐ1¸ö¾ÍÊDzÉÓÃWebBrowser¿Ø¼þ
µ«ÊÇʹÓÃWebbrowserÄã»á·¢ÏÖ,ÔÚDownloadCompleteʼþÖÐ,Äã¸ù±¾ÎÞ·¨ÖªµÀÒ³ÃæºÎʱ²ÅËãÊÇÕæÕýµ ......

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;
usi ......

ajax ´¦ÀíÒ첽ˢÐÂÖгöÏÖµÄÒì³£

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