ASP.NET AJAX ½Ìѧ±Ê¼Ç(Èý) 1
Ajax¿ª·¢ÈËÔ±ÐèÒªµÄJavaScript֪ʶ
JavaScriptµ®ÉúÓÚ1995 Ä꣬×î×³ÉÔÚNetsCape Navigatorä¯ÀÀÆ÷ÖС£Microsoft ÔÚIE3Öм¯³É¡£1998Äê±»±ê×¼»¯ÎªECMAScript.
Microsoft Ajax Library¸ÄÉÆÁËJavaScriptµÄÃæÏò¶ÔÏóÄ£ÐÍ¡£
3.1ʹÓöÔÏó
JavaScriptÖеĶÔÏó²¢²»ÊÇÀàÐ͵ÄʵÀý£¬ÒòΪJavaScript²»Ö§³ÖÀàµÄ¸ÅÄî¡£
JavaScriptҪͨ¹ýÔÐÍÕâÖÖÌØÊâÄÚ²¿¶ÔÏóÀ´µÃµ½¶ÔÏóµÄ½á¹¹»òÄ£°å¡£
JavaScript¶ÔÏóʵ¼ÊÉϾÍÊÇÃûÖµ¶ÔµÄÒ»¸ö¼¯ºÏ£¬ÕâЩÃûÖµ¶Ô³ÆΪÊôÐÔ¡£
3.1.1¶ÔÏó
Ò»£®´´½¨¶ÔÏó
Á½ÖÖ´´½¨¶ÔÏóµÄ·½·¨£º
(1) var book=new Object();
(2)var book={};//´´½¨¿Õ¶ÔÏó¡£
ÔÚJavaScriptÖпÉÒÔÔÚÈκÎʱºò¶¼¿ÉÒÔͨ¹ýÏò¶ÔÏóÔö¼ÓÐÂÊôÐÔÀ´À©Õ¹Õâ¸ö¶ÔÏ󡣿ÉÒÔÔÚÈκÎʱºòÐÞ¸ÄÀàµÄʵÀý¡£
¶þ£®Îª¶ÔÏóÔö¼ÓÊôÐÔ£º
Ϊ¶ÔÏóÔö¼ÓÊôÐÔ¿ÉÒÔÔÚÈκÎʱ¿ÌÔÚ´úÂëµÄÈκÎλÖÃÀ´ÊµÏÖ
Á½ÖÖ·½·¨£º
(1) book.title=”ASP.NET Ajaxʵս”;
(2)book[‘title’]= ”ASP.NET Ajaxʵս”;
Èý£®·ÃÎʶÔÏóµÄÊôÐÔÖµ£º
(1) alert( book.title);
(2)alert(book[‘title’]);
(3)ʹÓÃfor-in·ÃÎʶÔÏóËùÓÐÊôÐÔÈçÖµ£º
for( var pro in book){alrt(‘Name:’+ro,’value’+book[pro])}
ʾÀý£º
<script type ="text/javascript" >
Sys .Application .add_load (Page_Load);
function Page_Load()
{ var book=new Object ();
book.Title="ASP.NET Ajax ʵս";
book.Author="ËÕ½ð¹ú";
book.Publish="ÈËÃñÓʵç³ö°æÉç";
alert (book .Title);
alert (book['Author']);
for(var pro in book)
{ alert ('Name:'+pro+"\r\n"+'Value:'+book [pro]); }
 
Ïà¹ØÎĵµ£º
½üÀ´£¬Ëæ×ÅMono2.4ºÍJexus web server 2.3µÄ³É¹¦·¢²¼£¬ÔÚLinux ƽ̨¼ÜÉèAsp.netµÄʱ»úÒѾÍêÈ«³ÉÊì¡£ÓÉÓÚLinux·þÎñÆ÷ϵͳËù¾ß±¸µÄ´óÁ¿µÄÓŵ㣬¿ÉÒÔÔ¤¼Æ£¬¿çƽ̨µÄLinux ASP.NETÍøÕ¾±Ø½«½øÈëÎÒÃǵŤ×÷ÓëÉú²úʵ¼Ê¡£
Ãû´Ê½âÊÍ£º
Ò»¡¢Mono:
MonoÊÇÒ»¸ö¿ªÔ´ÏîÄ¿£¬ÊÇ°´ECMA-335¶¨ÒåµÄ±ê×¼Ö´ÐÐ.NET¿ò¼Ü£¬¼òµ¥µØ˵£¬Mono¾ÍÊÇ ......
×î½ü¿ª·¢ExtÓ¦Óã¬Ê¹ÓÃajaxÇëÇóÊý¾Ýʱ£¬Óöµ½ÁËÇëÇóÊý¾ÝÒÔ·µ»Ø£¬µ«IEÀïÈ´ÎÞ·¨ÏÔʾµÄ¹ÖÎÊÌâ¡£
ʹÓÃHTTPWatch²é¿´£¬·¢ÏÖERROR_INTERNET_CONNECTION_RESET¡£
ʹÓÃFireFoxºÍgoogleä¯ÀÀÆ÷¶¼Ã»ÓÐÎÊÌ⣬ÍøÉϲéÕÒ˵ÍøÕ¾·ÅÔÚIISÉÏûÓÐÎÊÌ⣬ÊÔÑéºóÖ¤Ã÷ÓÐЧ¡£
µ«Í¬Ê¿ª·¢Óûú´ó²¿·Ö¶¼ÊÇXPϵͳ£¬Óв¿·Ö»¹ÊÇHOME°æ£¬Òò´Ë¸ÃÎÊÌâ±ØÐëÕÒµ ......
<Ò»>Ò³Ã漶µÄ´íÎó´¦Àí
void Page_Error(Object sender, EventArgs e) {
String message = "<font face=verdana color=red>"
......
ÔÚWebÓ¦ÓóÌÐòÉÏÏÂÎÄÖУ¬ASP.NETÒ³Ãæ»áÔÚµÚÒ»´Î±»ÇëÇóʱ£¬°´Ðè±»¶¯Ì¬±àÒë¡£¶¯Ì¬±àÒë²¢²»ÊÇASP.NETÒ³Ãæ(.aspxÎļþ)ÌØÓеģ¬»¹·¢ÉúÔÚ.NET Web·þÎñ(.asmxÎļþ)¡¢WebÓû§¿Ø¼þ(.ascxÎļþ)¡¢HTTP´¦Àí³ÌÐò(.ashxÎļþ)£¬ÒÔ¼°ÆäËû¼¸ÖÖASP.NETÓ¦ÓóÌÐòÎļþ(Èçglobal.asaxÎļþ)ÉíÉÏ¡£ÔËÐÐʱ¹ÜµÀÄ£Ð͸ºÔð´¦ÀíÊäÈëµÄ(incoming)HTTPÊý¾Ý°ü ......
µÚÒ»Õ ASP.NET Ajax¼ò½é
1.1ʲôÊÇAjax
Ò»£®Ê²Ã´ÊÇAjax
AjaxÊÇAsynchronous JavaScript and XML(Òì²½JavaScript ºÍXML)µÄËõд£¬ÓÉÖøÃûÓû§ÌåÑéר¼ÒJesse-James GarrettÔÚ2005Äê2ÔÂ18ÈÕ·¢±íµÄһƪÃûΪAjax:a New Approach to Web ApplicationsÎÄÕÂÖÐÊ×ÏÈÌá³ö¡£
Ajax²¢²»ÊÇÖ»°üº¬JavaScri ......