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

ASP.NET"ÕýÔÚÖÐÖ¹Ïß³Ì"´íÎóÔ­¼°½â¾ö·½·¨

 ×î½ü×öµÄϵͳÖÐÀϳöÏÖµÄһЩÎÊÌⲻ̫Ã÷°×£¬ÔÚʹÓà Response.End¡¢Response.Redirect »ò Server.Transfer ʱ³öÏÖ ThreadAbortException £¬±¾À´ÏµÍ³ÊÇûÓÐÎÊÌâµÄ£¬ÔÚ±£´æÊý¾ÝʱҲ¿ÉÒÔÕý³££¬±¾À´Ê¹ÓÃtry-catch Óï¾äÊÇÓÃÀ´²¶»ñÒ»Òì³£Çé¿öµÄ£¬µ«ÏµÍ³Õý³££¬Àϲ¶»ñµ½ÏÂÃæµÄ¶«Î÷
##[²Ù×÷¼Ç¼]£º2010-02-23 9:25:12  System.Threading.ThreadAbortException: ÕýÔÚÖÐÖ¹Ï̡߳£
Ö¢×´
Èç¹ûʹÓà Response.End¡¢Response.Redirect »ò Server.Transfer ·½·¨£¬½«³öÏÖ ThreadAbortException Òì³£¡£Äú¿ÉÒÔʹÓà try-catch Óï¾ä²¶»ñ´ËÒì³£¡£
 
Ô­Òò
<!-- Inject Script Filtered -->
Response.End ·½·¨ÖÕÖ¹Ò³µÄÖ´ÐУ¬²¢½«´ËÖ´ÐÐÇл»µ½Ó¦ÓóÌÐòµÄʼþ¹ÜÏßÖÐµÄ Application_EndRequest ʼþ¡£²»Ö´ÐÐ Response.End ºóÃæµÄ´úÂëÐС£
´ËÎÊÌâ³öÏÖÔÚ Response.Redirect ºÍ Server.Transfer ·½·¨ÖУ¬ÒòΪÕâÁ½ÖÖ·½·¨¾ùÔÚÄÚ²¿µ÷Óà Response.End¡£
 
½â¾ö·½°¸
Òª½â¾ö´ËÎÊÌ⣬ÇëʹÓÃÏÂÁз½·¨Ö®Ò»£º
 
¶ÔÓÚ Response.End£¬µ÷Óà HttpContext.Current.ApplicationInstance.CompleteRequest ·½·¨¶ø²»ÊÇ Response.End ÒÔÌø¹ý Application_EndRequest ʼþµÄ´úÂëÖ´ÐС£
 
¶ÔÓÚ Response.Redirect£¬ÇëʹÓÃÖØÔØ Response.Redirect(String url, bool endResponse)£¬¸ÃÖØÔØ¶Ô endResponse ²ÎÊý´«µÝ false ÒÔÈ¡Ïû¶Ô Response.End µÄÄÚ²¿µ÷Óá£ÀýÈ磺
Response.Redirect ("nextpage.aspx", false);

Èç¹ûʹÓôËÌæ´ú·½·¨£¬½«Ö´ÐÐ Response.Redirect ºóÃæµÄ´úÂë¡£
   
¶ÔÓÚ Server.Transfer£¬Çë¸ÄÓà Server.Execute ·½·¨¡£


Ïà¹ØÎĵµ£º

ASP.NET³ÌÐòµ÷ÊÔ¾­³£ÒªÓõĸ¨Öú¹¤¾ß

ÔÚ½øÐÐASP.NETµ÷ÊÔµÄʱºò£¬ÎÒÃǾ­³£ÐèÒª½èÖúһЩÍⲿ¹¤¾ßÀ´¸¨ÖúÎÒÃÇ¡£Ë×»°Ëµ£¬¹¤ÓûÉÆÆäÊ ±ØÏÈÀûÆäÆ÷¡£¿É±ðС¿´ÁËÕâЩ¹¤¾ß£¬ËüÊÇÄã½â¾ö¸´ÔÓÎÊÌâµÄ±Ø±¸ÀûÆ÷¡£±È½Ï³£ÓõÄÓÐÕâЩ£º
HTTP×¥°ü¹¤¾ß£º Microsoft Network Monitor£¬Fiddler2£¬HttpWatcher µÈ£¬Ö÷ÒªÓÃÀ´²é¿´HTTPÏûÏ¢µÄheader£¬ÒÔ¼°body¡£ http://www.mscto.com
´ ......

ÀûÓÃASP.NETʵÏÖwebÌ×´ò

×î½ü£¬Òª°ÑÒ»¸öC/S½á¹¹µÄ³ÌÐò¸Ä³ÉB/S½á¹¹¡£ÆäÖоÍÓöµ½ÁË´òÓ¡µÄÎÊÌâ¡£Ñо¿ÁËһϣ¬webÏ´òÓ¡·½·¨´ó¸ÅÓÐÕâô¼¸ÖÖ£º
1¡¢ÀûÓÃIEÖ±½Ó´òÓ¡£¬ÕâÖÖ·½Ê½×î·½±ã£¬µ«ÊÇ¿ØÖÆÄÜÁ¦½Ï²î¡£
2¡¢ÀûÓÃACTIVE¿Ø¼þ£¬¿ÉÒÔ×Ô¼º×öÒ»¸öIEµÄ¿Ø¼þÀ´¿ØÖÆ´òÓ¡¡£
3¡¢Ë®¾§±¨±íµÈµÚÈý·½¹¤¾ß£¬¹ºÂò¼Û¸ñ°º¹ó¡£
    ¸ù¾ÝÎÒµÄÐèÇóÇé¿ö£¬ÓÃIEÖ ......

ASP.NET MVC ÈëÃÅ1¡¢¼ò½é

ʲôÊÇMVCģʽ
MVC£¨Model-View-Controller£¬Ä£ÐÍ—ÊÓͼ—¿ØÖÆÆ÷ģʽ£©ÓÃÓÚ±íʾһÖÖÈí¼þ¼Ü¹¹Ä£Ê½¡£Ëü°ÑÈí¼þϵͳ·ÖΪÈý¸ö»ù±¾²¿·Ö£ºÄ£ÐÍ£¨Model£©£¬ÊÓͼ£¨View£©ºÍ¿ØÖÆÆ÷£¨Controller£©¡£
ÄÇôMVCģʽºÍÎÒÃÇÊìϤµÄWebFormģʽÓÐʲô²»Í¬ÄØ£¿ËûµÄ¸÷¸ö²¿·ÖÓÖÊÇÔõÑù·Ö¹¤µÄÄØ£¿
ÎÒÃÇÏÈÀ´¿´Ò»ÏÂÆÕͨµÄWebFormģʽÏ£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ