ASP.NET AJAX ÖУ¬Óà JavaScript µ÷Ó÷þÎñÆ÷¶ËµÄ·½·¨
ÕâÀï²»ÊÇÖ¸µ÷Óüòµ¥µÄ PageMethod£¬ÒòΪ¾²Ì¬·½·¨ÊDz»ÄܲÙ×÷µ±Ç°Ò³ÃæµÄ¿Ø¼þµÄ£¬ËùÒÔ¾²Ì¬µÄ PageMethod ×÷Óþ͸úÆÕͨµÄ WebService Ò»Ñù£¬±È½Ï¾ÖÏÞ¡£
ÄÇô£¬µ÷ÓÃÒ»°ãµÄ·þÎñÆ÷¶Ë·½·¨£¬Æäʵ¾ÍÊÇ·¢ÆðÒ»¸öÒì²½»Øµ÷¡£×î¼òµ¥µÄʵÏÖ°ì·¨£¬ÊÇͨ¹ý UpdatePanel À´×ö¡£
Ê×Ïȶ¨ÒåÒ»¸öÒþ²ØµÄ LinkButton£¬ÔÚÆä´¦ÀíʼþÖУ¬È¥µ÷ÓÃÎÒÃÇÒªÖ´ÐеIJÙ×÷£º
<asp:LinkButton ID="linkUpdatePosts" runat="server" style="display:'none';" OnClick
="linkUpdatePosts_Clicked" />
// Ë¢ÐÂÌû×ÓÁÐ±í£¨¹©¿Í»§¶Ë js µ÷Óã©
protected void linkUpdatePosts_Clicked(object sender, EventArgs e)
{
LoadPosts();
}
È»ºó JavaScript ÖоͿÉÒÔ¶¨Ò庯ÊýÀ´´¥·¢Õâ¸ö LinkButton µÄ»Ø·¢£º
// Ë¢ÐÂÌû×ÓÁбí
function refreshPosts() {
__doPostBack('<%= linkUpdatePosts.UniqueID %>', '');
}
Ïà¹ØÎĵµ£º
log into file
//
ob_start();
echo "<pre>";
print_r($data);
echo "</pre>";
$a=ob_get_contents();
//DAL::remove("insert into mytest(vvv) values('$a')");
$filename = "file.txt";
$file = fopen($filename, "w") ......
JavaScriptÔÊÐí´´½¨ºÍ´ò¿ª´ú±íHTMLÎı¾, form¶ÔÏóºÍframeµÄ´°¿Ú. window¶ÔÏóÊÇJavaScript¿Í»§²ã´Î½á¹¹µÄ×î¶¥²ã¶ÔÏó, formÔªËØºÍÈ«²¿JavaScript´úÂë¶¼ÊÇ´æÔÚÓÚÎĵµÖÐ,¶øÎĵµ±»×°Ôؽø´°¿Ú. ΪÁËÀí½â´°¿ÚÔõÑù¹¤×÷,Äã¿ÉÒÔ¿ØÖƲÙ×÷ÕâЩ´°¿Ú.
´ò¿ªºÍ¹Ø±Õ´°¿Ú
µ±Óû§Æô¶¯(launch)Navigatorʱ,½«×Ô¶¯´´½¨Ò»¸ö´°¿Ú.Óû§»¹¿ÉÒÔÊ¹Ó ......
ÕâÖÖÐÂʽµÄ¼¼Êõ×îÏÈÓÉjQuery¸ã³öÀ´µÄ£¬½Ó×ÅPrototypeÓëmootools¶¼Ö§³ÖÁË¡£Õâ¼¼ÊõÐËÆðµÄÔÒòÊÇä¯ÀÀÆ÷Ðá̽¼¼ÊõÊDz»Ì«¿É¿¿£¬ÈçUserAgentºÜÈÝÒ×±»Î±Ô죬ÈçIE8µÄUserAgent¾Í°ÑÐí¶àä¯ÀÀÆ÷µÄ¹Ø¼ü×Ö°üº¬½øÈ¥£¬Ôì³É±çʶÀ§ÄÑ¡£ÆäËûÒ»Ð©ÖØÒª±çʶÊֶΣ¬ÓÉÓÚä¯ÀÀÆ÷³§É̶Ծɰ汾µÄÉý¼¶Óë²»¶ÏÍÆ½øÐ°汾£¬Ðí¶à¶¼ÎÞЧÁË¡£ÓÉÓÚä¯ÀÀÆ÷ÖÖÀàÔ½À´ ......
javascriptÑØÓÃjavaµÄ×Ö·û´¦Àí·½Ê½£¬ÄÚ²¿ÊÇʹÓÃunicodeÀ´´¦ÀíËùÓÐ×Ö·ûµÄ£¬
µÚ¶þ£¬utf-8ÊÇÿ¸öºº×Ö£¨unicode×Ö·û£©ÓÃ3¸ö×Ö½ÚÀ´´æ´¢¡£
µÚÈý£¬ÓÃutf-8À´sendÊý¾ÝÊDz»»á³öÏÖÂÒÂëµÄ£¬ÊǺǫ́³ÌÐòûÓÐÕýÈ·½âÂë²Å»á³öÏÖÂÒÂë¡£
µÚËÄ£¬ajax·¢ËÍÊý¾ÝµÄʱºòÈç¹ûÐÞ¸Ä Content-Type Ϊ application/x-www-form-urlencoded"£¬¿Ï¶ ......
ÎÊÌâ:
ÓÃÓÚÔËÐÐ ASP.NET µÄ½ø³ÌÕÊ»§±ØÐë¾ßÓÐ¶Ô IIS ÔªÊý¾Ý¿â(Èç IIS://servername/W3SVC)µÄ¶Á·ÃÎÊȨ¡£
³öÏÖ´ËÎÊÌâ¶àÊÇÒòΪÏÈ×°.net frameworkºó×°IIS Ôì³É
½â¾ö·½·¨:
¿ªÊ¼->³ÌÐò->Microsoft .NET Framework SDK v2.0->SDK ÃüÁîÌáʾ
ÊäÈë
aspnet_regiis -i »Ø³µ
---OVER--- ......