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
Ïà¹ØÎĵµ£º
ÈÎÖ°×ʸñ:
1. ´óѧ±¾¿ÆÒÔÉÏѧÀú£¬ÈýÄêÒÔÉÏÈí¼þ¿ª·¢¹¤×÷¾Ñé»ò»¥ÁªÍø¿ª·¢¾Ñ飻¾ßÓжþ¸ö¼°ÒÔÉÏÖÐÐÍÏîÄ¿µÄ³É¹¦ÊµÊ©¾Ñ飻
2. ÓÐ׼ȷÀí½âÐèÇ󡢼ܹ¹ÄÜÁ¦£¬ÓнÏÇ¿µÄ³ÌÐòÉè¼ÆÄÜÁ¦, ÊìϤÃæÏò¶ÔÏó·ÖÎö¡¢Èí¼þ¹¤³Ì¡¢UMLµÈÏà¹Ø¼¼Êõ£»
3. ÊìÁ·ÕÆÎÕ¼ÆËã»ú±à³ÌÒ»°ã˼ÏëºÍ·½·¨£»ÊìϤһÖÁÁ½ÖÖÃæÏò¶ÔÏó±à³ÌÓïÑÔ£»¾«Í¨.NET¡¢ C#¡¢ASP.net¡ ......
½«ViewState³Ö¾Ã»¯±£³ÖÔÚ·þÎñÆ÷¶ËÎļþµÄ´úÂ룬ÕâÑùViewState²»Õ¼ÓÃÍøÂç´ø¿í£¬Òò´ËÆä´æÈ¡Ö»ÊÇ·þÎñÆ÷µÄ´ÅÅ̶Áȡʱ¼ä¡£²¢ÇÒËüºÜС£¬¿ÉÒÔ˵ÊÇ´ÅÅÌËæ±ãתһȦ¾ÍÄÜͬʱ¶ÁÈ¡ºÃ¶àViewState£¬Òò´Ë¿ÉÒÔ˵“²»Õ¼Ê±¼ä”¡£ÎªÁËÔÙ“²»Õ¼´ÅÅÌʱ¼ä”£¬ÎÒ»¹Ê¹ÓÃÁË»º´æ¡£
´´½¨Ò»¸ö»ùÀà:
public class
BasePage : Sys ......
ÔÎĵØÖ·:http://blog.csdn.net/ChengKing/archive/2009/01/01/3678774.aspx
ÊôÐÔµÄÉè¼ÆʱÌØÐÔ
.NET Framework
Ϊ
¿Ø¼þÉè¼ÆʱÊôÐÔÌṩÁ˺ܶà·á¸»µÄÀ࣬ÕâЩÊôÐԵŦÄܷdz£Áé»î£¬¿ØÖÆ·¶Î§¹ã·º£¬±ÈÈç¿ÉÒÔ¿ØÖƸÃÊôÐÔÔÚÊôÐÔ´°¿ÚÖеÄÏÔʾģʽ£¬È磺ÊÇ·ñÔÚÊôÐÔ´°¿ÚÖÐÏÔʾ¸ÃÊô
ÐÔ£¬Ò²¿ÉÒÔÖ¸¶¨´ËÊôÐÔ±ØÐë½ÓÊÕÖµÀàÐÍÃèÊö£¬°´×é· ......
ÔÚASP.NETÍøÕ¾ÖÐÍøÕ¾¹ÜÀíºǫ́ÐèÒª¾³£ÑéÖ¤Óû§Éí·Ý,ҪʵÏÖÕâÖÖ¹¦ÄܾͿÉÒÔÀûÓÃÄǸö¼Ì³Ð»úÖƺÍASP.NETµÄʼþ»úÖÆ.Ê×Ïȶ¨ÒåÒ»¸öÐèÒª½øÐÐÉí·ÝÑéÖ¤µÄBasePageÀà,¼Ì³Ð×ÔPageÀà,ÔÚBasePageÀàµÄ¹¹Ô캯ÊýÖж¨ÒåËüµÄ¼ÓÔØʼþµÄ´¦Àí´úÂë,ÕâÑùËùÓм̳Ð×ÔBasePageÀàµÄÒ³Ã涼ÄÜ×Ô¶¯Ö´ÐÐÉí·ÝÑéÖ¤.
/// <summary>
/// ÑéÖ¤ ......
http://www.knowsky.com/5723.html
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
......