Ôõôajax¿Ø¼þupdatepanelÔÚwebͨÓÃÏîÄ¿ÖÐÎÞЧ?
ÔÚÍøÉÏ¿´µ½Ò»¶ÎÓйØupdatepanelµÄÓ¦Ó÷¶Àý,·Åµ½Í¨ÓõÄWEBÏîÄ¿ÖÐÎÞЧ,µ«·Åµ½AJAX ENABLEÏîÄ¿ÖоͿÉÒÔ,
ÎÒÏÖÔÚÏëÔÚͨÓõÄWEBÏîÄ¿ÖÐÓ¦ÓÃPANEL,²»ÖªµÀÈçºÎ²Ù×÷.(ÇëÎÊÎÒÒªÔõô²Ù×÷ÄØ?)
·¶Àý´úÂëºÜ¼òµ¥:ÈçÏÂ:(ÔÚͨÓÃÏîÄ¿ÖÐÎÞЧ,µ«ÔÚAJAX ENABLEÓÐЧ):
HTML code:
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="always">
<ContentTemplate>
<%= DateTime.Now%>
<asp:Button ID="Button1" runat="server" Text="¸üÐÂ1" /></ContentTemplate>
</asp:UpdatePanel>
<hr />
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
<ContentTemplate>
<%= DateTime.Now %>
<asp:Button ID="Button2" runat="server" Text="¸üÐÂ2" /></ContentTemplate>
</asp:UpdatePanel>
²ÎÕÕÒ»ÏÂAJAX ENABLEÏîÄ¿ÐÞ¸ÄÒ»ÏÂweb.configºÍdllÒýÓÃ
2005µÄʱºòÒª½øÐÐÅäÖòſÉÒÔʹÓõÄÕâ¸ö£¬Äã¿ÉÒÔÈ¥ÍøÉÏÕÒÕÒÔõôÅäÖÃ
Ïà¹ØÎÊ´ð£º
function Fun1(para1,para2)
{
Fun2(para1);
....
ÒªÇóÊÇ:Ôڵõ½ajax·½·¨µÄ·µ»ØÖµºó£¬
ÔÙʹÓÃpara2(para2ÊÇÒ»¸öjavascript±äÁ¿)
ÎÊÌâ¾ÍÊÇ£¬
&nb ......
ÈçÌ⣬
¶øµ±Á´½Óµ½±ðµÄÒ³Ã棬ÔÙ·µ»ØÕâ¸öÒ³Ã棬ÓÖ³öÏÖajax ÁË£¬Ì«Ææ¹ÖÁË
ÄÄλ°ï°ï°¡£¬
ÔõôûÈËÀ´°ïÎÒѽ£¬×Ô¼ºÏȶ¥Æð
¸ßÊÖÔÚÄÄѽ
ºô»»¸ßÊÖ
Õæ²»ÖªµÀÄãʲôÒâ˼°¡
ÎÒÒ²Åöµ½¹ý£¬Ò»ÏÂÓÖÍüÁËÔõô½ ......
request.responseText¿ÉÒԵõ½·µ»ØµÄÒ³ÃæÊý¾Ý
µ«ÊÇÔÚ·þÎñÆ÷¶ËÉèÖõÄattribute£¬Ôڻص÷º¯ÊýÖУ¬Í¨¹ýrequest.getAttributeûÓа취µÃµ½
ÁíÍâ·¢ÏÖresponseText²»ÊDZê×¼µÄrequestµÄ·½·¨£¬Õâ¸öapiÔÚÄÄ¿ÉÒÔ²éµ½Ä ......
Ò»°ãµÄÍøÕ¾¼´Ê±Í¨Ñ¶ÖÐÓÐÕâôһ¸ö¹¦ÄÜ£º
·Ã¿ÍÏûÏ¢Ô¤Öª¹¦Äܲ»½ö¿ÉÒÔ¿´µ½·Ã¿ÍµÄʵʱÊäÈë¶Ô»°ÄÚÈÝ£¬»¹¿ÉÒÔÅжϸ÷ÿ͵ÄʵʱÊäÈë״̬£¨ÕýÔÚÊäÈë»òÍ£Ö¹ÊäÈ룩£¬ÊäÈë»áÄÚÈÝÔÚµÚһʱ¼äÄÚ³öÏÖÔÚ¼´Ê±Í¨ÐÅÈí¼þµÄʵʱ¼à¿ØÎı¾ ......