Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ajaxµÄʹÓÃÎÊÌâ

ajaxʹÓÃÖÐÓöµ½¼¸¸öÎÊÌ⣬Çë¸÷λ°ïæ¡£

1¡¢Ê¹Óà alert(xmlhttp.responsetext); µ¯³öµÄÈ´ÊÇÕû¸öÒ³ÃæµÄHTMLÎı¾¡£
2¡¢Ê¹ÓÃxmlhttp·¢³öµÄÇëÇó£¬ÔÚÁíÒ»Ò³ÃæµÄPage_LoadÀͨ¹ýÓï¾äµÃµ½Ò»¸ö±íµÄÖµ£¬ÈçºÎ½«Õâ¸ö±íµÄÖµ·µ»Ø£¿È»ºóͨ¹ýAJAX½«·µ»ØµÄÖµ¸³¸ø±¾Ò³Ò»¸öultrawebgrid?



ÏȰÑhtml´úÂëÇå¿ÕÁË.

»òÕßÇëÇó.ashx or webservice

1.ÇëÇóaspxÒ³ÃæÊ±¼ÓÉÏresponse.end()
2.ûÓùýÄãÄÇÍæÒâ

ÔÚÁíÒ»Ò³ÃæµÄPage_LoadÀͨ¹ýÓï¾äµÃµ½Ò»¸ö±íµÄÖµ
dsΪһ¼Ç¼¼¯
DTΪ±í
  DT = ds.Tables("Prod")
    If DT.Rows.Count > 0 Then
      Response.Write()'ÔÚÕâÀïÔõôдȡÕâ¸ö¼Ç¼¼¯Õâ¸ö±íµÄÖµ£¿

    End if


1.°ÑÄãµÄAJAXÇëÇóµÄASPXÒ³ÃæµÄHTMLÒ³ÃæÈ«É¾µô£¬¾ÍÁôÏ·þÎñÆ÷¶ÎµÄ±êʾ <%..........%>ÄÇЩ¶«Î÷
2.ÄãµÃµ½µÄÊÇÒ»¸öDT,Ҫȡһ¸ö±íµÄÖµ£¿É¶Òâ˼£¬ÄãÒªÊÇҪȡ·µ»Ø±íµÄÊ×ÐÐÊ×ÁоÍÊÇDT.Rows[0][0].tostring();ÒªÊÇÒª·µ»ØÕû¸öDT£¬ÄǾÍÂé·³µãÁË£¬ÄãµÃ°ÑDTµÃÊý¾Ýת»»³ÉXML£¬·µ»ØXML£¬»òÕßת»»³ÉJSON£¬·µ»Ø¶¼ÐÐ...

ÇëÇó.ashx

1, È«²¿html ,˵Ã÷ÄãÍü¼ÇдÉÏ respon.write.end() ·½·¨
2. ·µ»ØµÄ±í,ҲҪת»»Îª×Ö·û´®, ¿ÉÒÔÊÇxml¸ñʽ, Ò²¿ÉÒÔjson ,
¹Ø¼üÊÇÄãÔÚǰ̨ÈçºÎ´¦ÀíÕâ¸ö·µ»ØµÄÊý¾Ý.Ö»ÄÜдjs Ò»¸öÒ»¸ö°ó¶¨

¹ØÓÚµÚ¶þµã£¬ÄÜ·ñÔÙ°ï˵¾ßÌåµã¡£¾ÍÊÇ·µ»ØÕû¸öDT¡£ÈçºÎתΪXMLÊý¾Ý£¬Ð»Ð»¡£

ajaxÇëÇóµÄÄǸöaspxÎļþÕâÑùд
<%
//´úÂë
%>

ÆäËûµÄ¶¼²»Òª£¬aspx.csÎļþÒ²²»Òª

LZµÄд·¨Ã»Óùý£


Ïà¹ØÎÊ´ð£º

ajax <scriptmanager>µ÷ÓÃwebserviceµÄÎÊÌâ

ÓÃwindow.setIntervalÕâÑùµÄJS´úÂë5Ãëµ÷ÓÃÒ»´Î£¬½á¹ûIE±¨¾¯£º
¸ÃÒ³ÃæÉϵĽű¾Ôì³ÉieÔËÐлºÂý£¬Èç¹û¼ÌÐøÔËÐÐÄãµÄ¼ÆËã»ú»á±äµÃ¸üÂý£¿
´úÂëÈçÏ£º
<body onload="gLStat()">
  &nbs ......

¹ØÓÚajax¿Ø¼þNumericUpDownExtenderµÄʹÓÃÎÊÌâ

ÎÒÓÃNumericUpDownExtender£¬ÉèÖÃÁ˶ÔÓ¦µÄÒ»¸öÎı¾¿ò£¬

<cc1:NumericUpDownExtender ID="nctk4"  runat="server"
                ......

ÇóÒ»¶Î¼òµ¥µÄAJAX´úÂë¡£ÒªÊÖдXMLHttpRequest¶ÔÏóµÄ

¸Õ¿ªÊ¼Ñ§£¬ÇóÒ»¶Î¼òµ¥µÄAJAX´úÂë¡£ÒÔǰÓÃASP.NET AJAX AJAX Extensions À´×Å¡£Ò²¶®¾ÍϹÓá£ÏÖÔÚÇóÒ»¶Î´ú´úÂë¡£AJAXµ÷ÓÃc#´úÂë¡£Ò²²»ÎÒ˵µÄÄã²»Ã÷°×£¬ÎÒ¾ÍÊÇÏ£ÍûÓÃAJAX»ñÈ¡Êý¾Ý¿âÊý¾Ý.²»ÒªµÚÈý·½µÄDLL  ÀýÈçAjax ......

»ùÓÚAjaxµÄ¸öÈ˲©¿ÍÍøÕ¾ÕýʽÉÏÏߣ¬É¢·Ö

¾­¹ýÒ»¸öÐÇÆÚµÄ²»¶ÏŬÁ¦£¬ÎҵĻùÓÚAjaxµÄ¸öÈ˲©¿ÍÖÕÓÚ¿ÉÒÔÕýʽÉÏÏßÁË¡£
ÏÖÔÚÉ¢·Ö½ÓÊܸ÷λ´óÏÀµÄ±ÉÊÓ¡£
ÍøÖ· www.bleehome.cn  BLEE HOME

(±¾À´Ïë¶àÉ¢µã£¬µ«ËµÎÒÖ»ÄÜÉ¢100.Õâ¸öµ½Ê±ÔÙÏëÏë°ì·¨)
~j ......

AjaxÖлص÷º¯ÊýµÄ´¦Àí½á¹ûûÓзµ»Ø£¿

JScript code:

function callback() {
alert(18); //²âÊÔÊÇ·ñµ÷ÓÃÁËcallback»Øµ÷º¯Êý
if (httpRequest.readyState==4) {
if(httpRequest.status==200){
alert(3); //²âÊÔÊ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ