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

AJAXÖÐUpdatePanel¿Ø¼þÊôÐÔµÄÏà¹Ø½éÉÜ

RenderModeÊôÐÔ£ºÊ¹ÓÃijһ¸öÔªËØȦ³öÒ»¸öÇøÓò£¬ËüÓÐÁ½¸öÖµ£º— Block(ĬÈÏ)¡¢Inline
Block£ºÊ¹ÓõÄdiv±ê¼Ç£»Inline£ºÊ¹ÓõÄÊÇspan±ê¼Ç
UpdateModeÊôÐÔ£ºÒ»¸öUpdateModeÔÚij´ÎÒì²½»ØËÍÖ®ºó£¬Ëü²¢²»Ò»¶¨»á¸üУ¬Ëý¿ÉÄÜÐèÒªÂú×ãÒ»¶¨µÄÌõ¼þ²Å¸üУ¬Èç¹ûÒ»¸ö
UpdatePanelµÄUpdateModeΪAlways(×ÜÊÇ)£¬Ôò±íʾÔÚij´ÎÒì²½´«ËÍÖ®ºó¿Ï¶¨»á¸üУ¬Èç¹ûΪConditional£¬ÕâÐèÒªUpdatePanel
Âú×ãÒ»¶¨µÄÌõ¼þʱ²Å¸üÐÂ(±à³Ìʱ¾¡Á¿ÉÙÓÃAlways£¬¶àÓÃConditional£¬ÕâÑù¼õÉÙÊý¾Ý´«ÊäÁ¿£¬Ìá¸ßЧÂÊ)
ChildrenAsTriggersÊôÐÔ£ºÊÇÒ»¸öboolÖµµÄÊôÐÔ£¬Ä¬ÈÏֵΪTrue£¬´¥·¢UpdatePanel¸üеÄÒ»¸ö´¥·¢Æ÷£¬Èç¹ûChildrenAsTriggers
ΪTrue£¬¶øÇÒÒ»¸öÒì²½µÄPostBackÊÇÓÉUpdatePanelÄÚ²¿µÄÒ»¸ö¿Ø¼þÒýÆðµÄ(¼´ÄÚ²¿¿Ø¼þÒýÆðµÄÒì²½PostBack)£¬Ôòµã»÷Õâ¸ö°´Å¥ÒýÆðajaxµÄÒì²½»ØËÍ£¬Õâ¸öUpdatePanel¾Í»á¸üС£
Triggers¼¯ºÏÊôÐÔ£ºÊÇÒ»¸öUpdatePanel(ÊÇÒ»¸ö³éÏóÀà)¶ÔÏóµÄ¼¯ºÏ£¬AsyncPostBackTriggerÔÚÒ³ÃæÉÏÖ¸¶¨Ò»¸ö¿Ø¼þ£¬
Èç¹ûÊǸÿؼþÒýÆðajaxÒì²½»ØËÍ(´Ë¿Ø¼þÔÚUpdatePanelÄÚ£¬µ±È»¿Ø¼þÒ²¿ÉÒÔÔÚUpdatePanelÍ⣬ÉõÖÁÔÚÁíÒ»¸öUpdatePanelÄÚ¶¼¿ÉÒÔ)£¬ÕâUpdatePanel¾Í»á¸üУ¬£»PostBackTriggerÒ²ÊÇÖ¸¶¨Ä³Ò»¸ö¿Ø¼þ£¬ÊÇÈÃÄǸö¿Ø¼þÒý·¢µÄ»ØËͲ»ÊÇÒì²½µÄ£¬Òý·¢Ò»¸öͬ²½µÄPostBack£¬Õâ¸öÒ³Ãæ»á½øÐÐÍêÕûµÄˢС£


Ïà¹ØÎĵµ£º

[ËÄÌìѧ»áajax]ѧϰajax½Ì³ÌµÚËÄÌì

ÔÚ HTML µÄÍⲿÎļþÖÐÒ»Ñù£¬±ê¼ÇµÄ×éÖ¯ÓëÆäÑùʽ¡¢¸ñʽºÍÐÐΪÊÇ·ÖÀëµÄ¡£ËäÈ»Äú¿Ï¶¨¿ÉÒÔÓà JavaScript ¸ü¸ÄÔªËØ»òÎı¾µÄÑùʽ£¬µ«Êµ¼Ê¸ü¸ÄÄúµÄ±ê¼ÇËù²¼ÖõÄ×é֯ȴ¸ü¼ÓÓÐȤ¡£
Ö»ÒªÀμÇÄúµÄ±ê¼ÇֻΪÄúµÄÒ³ÃæÌṩ×éÖ¯¡¢¿ò¼Ü£¬Äú¾ÍÄÜÁ¢ÓÚ²»°ÜÖ®µØ¡£ÔÙÇ°½øһС²½£¬Äú¾Í»áÃ÷°×ä¯ÀÀÆ÷ÊÇÈçºÎ½ÓÊÜËùÓеÄÎı¾×éÖ¯²¢½«Æäת±äΪ³¬¼¶ÓÐȤµ ......

AJAXºÍXMLHTTPÔ­Àí

AjaxµÄÔ­Àí¼òµ¥À´ËµÍ¨¹ýXmlHttpRequest¶ÔÏóÀ´Ïò·þÎñÆ÷·¢Òì²½ÇëÇ󣬴ӷþÎñÆ÷»ñµÃÊý¾Ý£¬È»ºóÓÃjavascriptÀ´²Ù×÷DOM¶ø¸üÐÂÒ³Ãæ¡£ÕâÆäÖÐ×î¹Ø¼üµÄÒ»²½¾ÍÊÇ´Ó·þÎñÆ÷»ñµÃÇëÇóÊý¾Ý¡£ÒªÇå³þÕâ¸ö¹ý³ÌºÍÔ­Àí£¬ÎÒÃDZØÐë¶Ô XMLHttpRequestÓÐËùÁ˽⡣
XMLHttpRequestÊÇajaxµÄºËÐÄ»úÖÆ£¬ËüÊÇÔÚIE5ÖÐÊ×ÏÈÒýÈëµÄ£¬ÊÇÒ»ÖÖÖ§³ÖÒì²½ÇëÇóµÄ¼¼Êõ ......

AjaxµÄÎÞˢзÖÒ³

AjaxµÄÎÞˢзÖÒ³
ÕâÀïÒÔÁ½¸öÎļþ½øÐдúÂëÏÔʾһ¸öÊÇajax·ÖҳʵÏÖµÄÎļþ£¬ÁíÒ»¸öÊÇ·ÖÒ³ÀàÎļþ
Îļþ1.ajax_page.php
<script type="text/javascript" language="javascript">
 function createXMLHttp()
 {
  var browser=navigator.appName; //get the current browser
   ......

¶ÔAjaxµÄһЩ»ù±¾Àí½â

Ò»¡¢ajaxµÄÈëÃÅ
  1¡¢XMLHttpRequest¶ÔÏóµÄʹÓã¨Ê¹ÓÃXMLHttpRequest½âÎöxmlÎļþ£©
 onreadystatechange
Ö¸¶¨µ±readyStateÊôÐԸıäʱµÄʼþ´¦Àí¾ä±ú
 open()
´´½¨Ò»¸öеÄhttpÇëÇ󣬲¢Ö¸¶¨´ËÇëÇóµÄ·½·¨¡¢URLµÈÐÅÏ¢
 send()
·¢ËÍÇëÇóµ½http·þÎñÆ÷²¢½ÓÊÕ»ØÓ¦
 readyState
&nb ......

AJAXÏ»ñÈ¡¸üÐÂÖµµÄÎÊÌ⣬δ½â¾ö

ʹÓÃAJAXÖеÄUpdatePanel
ÔÚUpdatePanelÖÐÌí¼ÓÒ»GridView,Ìí¼ÓÁËRow_Updatingʼþ£º protected void gvUnitList_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
GridViewRow row = gvUnitList.Rows[e.RowIndex];
UnitModel unit = new UnitModel();
unit.UnitID = Convert.ToI ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ