ASP.NET AJAX ʹÓÿͻ§¶Ëµ÷Ó÷þÎñÆ÷¶ËµÄ·½·¨
Microsoft ASP.NET AJAX¿ÉÒԺܷ½±ãµÄÈÃÎÒÃÇÔÚ¿Í»§¶ËʹÓýű¾µ÷ÓÃASP.NET Web
Services(.asmx),ÒªÆôÓÃÕâÒ»ÌØÐÔ£¬ÏñÇ°ÃæÌáµ½µÄÒ»Ñù£¬±ØÐëÒªÅäÖÃWeb.Config£¬¿ÉÒÔ²ÎÕÕMicrosoft ASP.NET
AJAX°²×°Ä¿Â¼ÏµÄWeb.Config£¬Èç¹ûÊÇͨ¹ýASP.NET AJAX-enabled Web
siteÄ£°æ½¨Á¢µÄÕ¾µã£¬Ôò²»ÐèÒªÔÙ½øÐÐÉèÖÃÁË¡£ÅäÖýڵãÈçÏ£º
<system.web>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx"
validate="false"
type="System.Web.Script.Services.ScriptHandlerFactory"/>
</httpHandlers>
<system.web>
ÒÔÉÏÅäÖýÚΪWebÓ¦ÓóÌÐòÌí¼ÓÁËÒ»¸öHTTP handler£ºScriptHandlerFactory£¬ËüµÄ×÷ÓÃÊÇ´¦Àí½Å±¾µ÷ÓÃWeb
ServiceµÄÇëÇó£¬Èç¹ûÊǷǽŲ½¶Ô.asmxµÄµ÷ÓÃÇëÇó£¬Ôòת¸øĬÈϵĴ¦ÀíÆ÷¡£
ʹÓýű¾µ÷Ó÷þÎñÆ÷·½·¨ÓÐÁ½ÖÖ·½Ê½£¬Ò»ÖÖÊǵ÷Óó£¹æµÄASP.NET Web
Service£¬ÁíÒ»ÖÖÖ±½Óµ÷ÓÃÒ³Ãæ´úÂëÒ³Éϵķ½·¨¡£Á½ÖÖ·½Ê½¶¼·Ç³£¼òµ¥£¬¶ÔÓÚÇ°Õߣ¬ÎÒÃÇÖ»ÐèÔÚÏÖÓеÄWeb ServiceÉÏÔö¼ÓÒ»¸öÊôÐÔ£º
[System.Web.Script.Services.ScriptService]
¶ø¶ÔÓÚÒ³ÃæÉϵķ½·¨£¬Ö»Ðè¸øÏÖÓз½·¨Ôö¼ÓÈçÏÂÌØÐÔ,²¢¸ÄΪ¾²Ì¬·½·¨£º
[System.Web.Services.WebMethod]
ÏÂÃæÎÒÃÇ·Ö±ð¶ÔÆä½øÐÐÏêϸÌÖÂÛ¡£
Web Service·½Ê½
Ê×ÏÈΪÏîÄ¿Ìí¼ÓÒ»¸öÎļþ¼ÐWebServices£¬À´´æ·ÅËùÓÐÒªÓõ½µÄWeb ServcieÒ³Ã棬ȻºóÔÚWeb
ServicesÎļþ¼ÐÏÂÃæÌí¼ÓÒ»¸ö Web
ServiceÃüÃûΪSimpleWebService.asmx£¬ÔÚºǫ́Ôö¼ÓÒ»¸öSayHello·½·¨£¬²¢Ö¸¶¨WebMethodÌØÐÔ¡£ÍêÕûµÄ´úÂëÈçÏ£º
SimpleWebService.cs
using
System;
using System.Web;
using System.Collections;
using
System.Web.Services;
using System.Web.Services.Protocols;
[System.Web.Script.Services.ScriptService]
[WebService(Namespace = "http://tempuri.org/
")]
[WebServiceBinding(ConformsTo
= WsiProfiles.BasicProfile1_1)]
public class SimpleWebService :
System.Web.Services.WebService
{
public SimpleWebService()
{
&nb
Ïà¹ØÎĵµ£º
ÔÚASP.NETÍøÕ¾ÖÐÍøÕ¾¹ÜÀíºǫ́ÐèÒª¾³£ÑéÖ¤Óû§Éí·Ý,ҪʵÏÖÕâÖÖ¹¦ÄܾͿÉÒÔÀûÓÃÄǸö¼Ì³Ð»úÖƺÍASP.NETµÄʼþ»úÖÆ.Ê×Ïȶ¨ÒåÒ»¸öÐèÒª½øÐÐÉí·ÝÑéÖ¤µÄBasePageÀà,¼Ì³Ð×ÔPageÀà,ÔÚBasePageÀàµÄ¹¹Ô캯ÊýÖж¨ÒåËüµÄ¼ÓÔØʼþµÄ´¦Àí´úÂë,ÕâÑùËùÓм̳Ð×ÔBasePageÀàµÄÒ³Ã涼ÄÜ×Ô¶¯Ö´ÐÐÉí·ÝÑéÖ¤.
/// <summary>
/// ÑéÖ¤ ......
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using ......
1. ´Óhttp://sqlite.phxsoftware.com ÏÂÔØSystem.Data.SQLite.dll
2. ´Óhttp://www.sqlite.org/download.html ÏÂÔØ sqlite3.dll
3. Copy ÒÔÉÏ2¸öDllµ½Asp.netÍøÕ¾µÄbinĿ¼Ï£¬ÀàËÆ E:\2009work\MyWeb\Bin
4. ÓÃsqlitespy ¹¤¾ßн¨Êý¾Ý¿â£¬E:\2009work\MyWeb\App_Data\db.db3 £ ......
¹ØÓÚASP.NETÒ³Ãæ´òÓ¡¼¼ÊõµÄ×ܽá
B/S½á¹¹µ¼ÖÂÁËWebÓ¦ÓóÌÐòÖдòÓ¡µÄÌØÊâÐÔ¡£
¡¡¡¡• ³ÌÐòÔËÐÐÔÚä¯ÀÀÆ÷ÖУ¬´òÓ¡»úÔÚ±¾µØ£¬¶øÎļþÈ·¿ÉÄÜÔÚ·þÎñÆ÷ÉÏ£¬µ¼ÖÂÁË´òÓ¡¿ØÖƲ»ÊǺÜÁé»î¡£
¡¡¡¡• ¸ñʽÈçºÎ¿ØÖƺͶ¨ÖƵȣ¬ÊÇÎÒÃÇ¿ª·¢ÖпÉÄÜ»áÃæ¶ÔµÄÎÊÌâ¡£
¡¡¡¡´òÓ¡ÎĵµµÄÉú³É
¡¡¡¡• 1¡¢ ......