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
Ïà¹ØÎĵµ£º
ÇëÇó·½Ê½£¬·ÖΪGETÓëPOST£º
GET
×îΪ³£¼ûµÄHTTPÇëÇ󣬯ÕͨÉÏÍøä¯ÀÀÒ³Ãæ¾ÍÊÇGET¡£GET·½Ê½µÄ²ÎÊýÇëÇóÖ±½Ó¸úÔÚURLºó£¬ÒÔÎʺſªÊ¼¡££¨JSÖÐÓÃwindow.location.search»ñµÃ£©¡£²ÎÊý¿ÉÒÔÓÃencodeURIComponent½øÐбàÂ룬ʹÓ÷½Ê½:
var EnParam = encodeURIComponent(param);
URLÖ»Ö§³Ö´óÔ¼2KµÄ³¤¶È£¬¼´2 ......
ajaxÈ«³ÆAsynchronous JavaScript and Xml ,Òì²½´«Êä¡£
Òì²½´«ÊäÊÇÃæÏò×Ö·ûµÄ´«Ê䣬ËüµÄµ¥Î»ÊÇ×Ö·û£»¶øÍ¬²½´«ÊäÊÇÃæÏò±ÈÌØµÄ´«Ê䣬ËüµÄµ¥Î»ÊÇÖ¡£¬Ëü´«ÊäµÄʱºòÒªÇó½ÓÊÜ·½ºÍ·¢ËÍ·¢µÄʼÖÕ±£³ÖÒ»Öµġ£
Òì²½´«ÊäÊǽ«±ÈÌØ·Ö³ÉС×éÀ´½øÐд«Êä¡£Ò»°ãÿ¸öС×éµÄÒ»¸ö8λ×Ö·û£¬ÔÚÿ¸öС×éµÄ ......
ʵʱÊý¾ÝÑéÖ¤ÊÇAJAX¼¼ÊõµÄÒ»´óÓÅÊÆÖ®Ò»¡£Í¨¹ýÓ¦Óô˼¼Êõ£¬strutsÑéÖ¤¿ò¼Ü½«ÔöÇ¿struts MVC£¬²¢Ê¹WebÓ¦ÓóÌÐò¸ü½Ó½üÓÚ×ÀÃæÓ¦ÓóÌÐò¡£
´ËÑéÖ¤¿ò¼ÜÓÃÓÚÑéÖ¤×ֶΡ£ÓÐÐí¶àÔÚWebÓ¦ÓóÌÐòÉϽøÐÐÑéÖ¤µÄ·½·¨¡£ÕâЩ·½·¨¿É·ÖΪÁ½Àࣺ·þÎñÆ÷¶Ë·½·¨ºÍ¿Í»§¶Ë·½·¨¡£StrutsÑéÖ¤¿ò¼ÜÊÇÃæÏò»ùÓÚJavaµÄWebÓ¦Óû·¾³µÄ×î¼Ñ¿ò¼ÜÖ®Ò»¡£ËüÄܹ»ÅäÖÃÓ ......
ÍêÈ«ÊÊÓÃ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 ......