Asp.net AJAX Web Serviceд·¨²îÒì
ÔÚC#ÖÐ
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Script.Services;
using System.Collections.Generic;
using System.Collections;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[GenerateScriptType(typeof(Employee ))]
[ScriptService]
public class PeopleManagementService : System.Web.Services.WebService
{
[WebMethod]
[ScriptMethod(UseHttpGet = true)]
public Employee CreateNewEmployee()
{
return new Employee();
}
}
vb.net
Imports System;
Imports System.Web;
Imports System.Web.Services;
Imports System.Web.Services.Protocols;
Imports System.Web.Script.Services;
Imports System.Collections.Generic;
Imports System.Collections;
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<GenerateScriptType(GetType(Employee))> _
<ScriptService()> _
Public Class PeopleManagementService
Inherits System.Web.Services.WebService
<WebMethod()> _
<ScriptMethod(usehttpget:=True)> _
Public Function CreateNewEmployee() As Employee
Return New Employee()
End Function
End Class
C#ÖеÄstatic,¶ÔÓ¦vb.net shared
ÒòΪ×Ô¼º»ù±¾ÉÏʹÓõÄvb.net£¬¿´µÄ×ÊÁÏÓÖ»ù±¾ÉÏÊÇC#µÄ£¬ºÜÉÙµÄvb.netµÄÀý×Ó£¬¾Í½«²îÒì¼Ç¼ÏÂÀ´
Ïà¹ØÎĵµ£º
APS.NETÒ¹»°µÄÀý×Ó¼ÓÔغ󱨴íÈçÏ£º
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35´íÎó
ÔÒòÊÇδÄܼÓÔØÎļþ»ò³ÌÐò¼¯ system.web.extensions
½â¾ö°ì·¨:
1,Èç¹ûÄãµÄ³ÌÐòÔËÐÐÔÚÄãÄÜ¿ØÖƵķþÎñÆ÷ÉÏ£¬ÄÇô°²×°asp.net ajax¾ÍÐÐÁË£¬ÕâÊÇSystem.Web.ExtensionsµÈdll×öΪGAC² ......
¶ÔÓÚ¿ª·¢Õß×ÔÉíµÄ»úÆ÷À´½²£¬¿ÉÄܳÌÐòÔËÐв»»áÓÐÈκÎÎÊÌ⣬µ«¹Ø¼üÊÇ£¬³ÌÐòÍùÍùÒª·¢²¼µ½Óû§µÄ»úÆ÷ÉÏ£¬Èç¹ûÓû§ÓÐרÃŵķþÎñÆ÷£¬ÄÇÁíµ±±ðÂÛ£¬µ«Èç¹ûÓû§Ö»ÊÇÏëÓÃһ̨ÆÕͨ²»ÄÜÔÚÆÕͨµÄ°ì¹«»úÆ÷µ±·þÎñÆ÷µÄ»°£¬·¢²¼³ÌÐò£¬¿ÉÄܾÍÒª×öµÄÊÂÇé¶àһЩ£º
1¡¢Ê×Ïȼì²éϵͳÓÐûÓа²×°iis£¬Èç¹ûûÓУ¬ÒªÉÏÍøÏÂÔØiisµÄ°²×°°ü£¬Í¨¹ý“ ......
web2.0ºá¿Õ³öÊÀ£¬ajaxÊ×µ±Æä³å£¬½ñÌì×öwebµÄÈç¹ûÔÙ²»Ñ§µãajaxµÄ»°£¬¾ÍÏÔµÄÂäÎéÁË£¬¶øѧajaxµÄÓõĻ·¾³Èç¹ûÊÇasp.net£¬ÄÇajax.netÄã¾Í²»µÃ²»Ñ§ÁË¡£Ê×ÏȾÍÊÇ»·¾³µÄÅäÖã¬ÈçÏÂ
vs2005+sql2005+Winxp sp2+ie6.0+Office2003»·¾³ÉèÖÃÈçÏ£º
ÏÂÔØÍê ASPAJAXExtSetup.msi °²×°¸üкóÔÚÄãµÄϵͳÅÌϵģ¨ÒÔCÅÌΪÀý£© ³öÏÖÕâ¸ö Îļ ......
1£©·¢ËÍ·¾¶ÖеIJÎÊýÓÐÖÐÎÄ£¬ÔÚ·þÎñÆ÷¶Ë½ÓÊÕ²ÎÊýÖµÊÇÂÒÂë
½â¾ö·½·¨£º
PHP:
·þÎñÆ÷¶Ë£ºiconv("UTF-8","gb2312",$_POST[±äÁ¿Ãû]);
JSP:
¿Í»§¶Ë:
ÀûÓÃjavascriptµÄÌṩµÄescape()»òencodeURI()·½·¨, Àý
var url="a.jsp?name=СÀî"£»
url=encodeURI(url);
url=encodeURI(url); //Á½´Î£¬ºÜ¹Ø¼ü[¾ßÌåΪʲô£¬ÎÒÒ²²»Çå³þ ......
ÈçÉÏͼËùʾΪAccordion¿Ø¼þ£º
¸Ð¾õ²»´íµÄÑùʽ
<style type="text/css">
.headerBg{cursor:hand;text-align:center;width:180px;height:21px;background-image:url(images/ajaxmenubg1.gif);FONT-SIZE: 12px;line-height:21px;} ......