¸ÅÊöASP.NET´íÎó´¦Àí
±¾ÎĽéÉÜASP.NET´íÎó´¦Àí£¬ÒÔ¼°½éÉÜÈç¹ûÄúµÄÓ¦ÓóÌÐòÊÔͼµÇ¼Êý¾Ý¿âʱûÓгɹ¦£¬ÔòÏÔʾµÄ´íÎóÐÅÏ¢²»Ó¦¸Ã°üÀ¨ËüÕýÔÚʹÓõÄÓû§Ãû¡£
Òª´´½¨Ò³ÖеÄÈ«¾Ö´¦Àí³ÌÐò£¬Çë´´½¨ Page_Error ʼþµÄ´¦Àí³ÌÐò¡£Òª´´½¨ASP.NETÓ¦ÓóÌÐò·¶Î§µÄ´íÎó´¦Àí³ÌÐò£¬ÇëÔÚ Global.asax ÎļþÖн«´úÂëÌí¼Óµ½ Application_Error ·½·¨¡£Ö»ÒªÄúµÄÒ³»òÓ¦ÓóÌÐòÖз¢Éúδ´¦ÀíµÄÒì³££¬¾Í»áµ÷ÓÃÕâЩ·½·¨¡£Äú¿ÉÒÔ´Ó HttpServerUtility.GetLastError ·½·¨»ñÈ¡ÓйØ×îдíÎóµÄÐÅÏ¢¡£
×¢Òâ Èç¹ûÄú¾ßÓÐÈ«¾Ö´íÎó´¦Àí³ÌÐò£¬ÔòËüÓÅÏÈÓÚÔÚ Web.config customErrors ÔªËØµÄ defaultRedirect ÊôÐÔÖÐÖ¸¶¨µÄASP.NET´íÎó´¦Àí¡£
ÔÔò£¨MSDN£©£ºÔÚÄúµÄÓ¦ÓóÌÐòÏÔʾ´íÎóÐÅϢʱ£¬Ëü²»Ó¦¸Ãй¶ÓÐÖúÓÚ¶ñÒâÓû§¹¥»÷ÄúϵͳµÄÐÅÏ¢¡£ÀýÈ磬Èç¹ûÄúµÄÓ¦ÓóÌÐòÊÔͼµÇ¼Êý¾Ý¿âʱûÓгɹ¦£¬ÔòÏÔʾµÄ´íÎóÐÅÏ¢²»Ó¦¸Ã°üÀ¨ËüÕýÔÚʹÓõÄÓû§Ãû¡£
ÓÐÐí¶à·½·¨¿ÉÒÔ¿ØÖÆ´íÎóÐÅÏ¢£º
½«Ó¦ÓóÌÐòÅäÖÃΪ²»ÏòÔ¶³Ì£¨Ó¦ÓóÌÐò£©Óû§ÏÔʾÏêϸ´íÎóÐÅÏ¢¡£ÄúÒ²¿ÉÒÔÑ¡Ôñ½«´íÎóÖض¨Ïòµ½Ó¦ÓóÌÐòÒ³¡£
Ö»Òª¿ÉÐоͰüÀ¨ASP.NET´íÎó´¦Àí£¬²¢±àдÄú×Ô¼ºµÄ´íÎóÐÅÏ¢¡£ÔÚÄúµÄ´íÎó´¦Àí³ÌÐòÖУ¬Äú¿ÉÒÔ½øÐвâÊÔÒÔÈ·¶¨Óû§ÊÇ·ñΪ±¾µØÓû§²¢×÷³öÏàÓ¦µÄÏìÓ¦¡£
ÔÚ²¶×½ËùÓÐδ´¦ÀíÒì³£²¢½«ËüÃÇ·¢Ë͵½Ò»°ã´íÎóÒ³µÄÒ³¼¶±ð»òÓ¦ÓóÌÐò¼¶±ðÉÏ£¬´´½¨È«¾Ö´íÎó´¦Àí³ÌÐò¡£ÕâÑù£¬¼´Ê¹ÄúûÓÐÔ¤Áϵ½Ä³¸öÎÊÌ⣬ÖÁÉÙÓû§²»»á¿´µ½Òì³£Ò³¡£
Ò».Ò³Ã漶µÄASP.NET´íÎó´¦Àí
1. voidPage_Error(Objectsender,EventArgse){
2. Stringmessage="<fontface=verdanacolor=red>"
3. +"<h4>"+Request.Url.ToString()+"</h4>"
4. +"<pre><fontcolorfontcolor='red'>"+Server.GetLastError().ToString()+"</pre>"
5. +"</font>";
6.
7. Response.Write(message);
8.  
Ïà¹ØÎĵµ£º
ASP.NET ÖеÄÉè¼Æģʽ֮MVCƪ
ASP.NET
ÖеÄÉè¼Æģʽ֮
MVC
ƪ
Éè¼Æģʽ
MVC
Ò³Ãæ¿ØÖÆÆ÷
Ä£°åÓë
Page
»ùÀà
Éè¼Æģʽ
Èí¼þ¿ª·¢ÖУ¬Èí¼þ¸´ÓúÍÍŶÓÐ×÷¶¼Ò»Ö±ÊÇ×îΪÈËÃǹØ×¢µÄÖØÒªÎÊÌâÖ®Ò»¡£ÓÐȤµÄÊÇ£¬ÕâÁ½¸öËƺõÊôÓÚÈí¼þ¹¤³Ì·¶³ëµÄÎÊÌⶼÓÐÒ»¸ö¹²Í¬µÄ¼¼Êõ·½ÃæµÄ½â¾öÖ®µÀ£ºÉè¼Æģʽ¡£
  ......
ÔÚWindows NTÖУ¬Í¼ÐζàýÌåϵͳ»ùÓÚ²ã´Î½á¹¹¡£Ó¦ÓóÌÐòÓ붥²ãµÄAPI£¨Êµ¼ÊÉÏÊǶà¸öÓû§Ä£Ê½µÄϵͳDLL£¬±ÈÈçGDI32.DLL£©½»»¥£¬ÕâЩϵͳDLL×îÖÕ»áͨ¹ýϵͳ·þÎñµ÷Óô¦ÓÚÄÚºËģʽµÄϵͳ·þÎñ¡£
NTϵͳµÄÏêϸÐÅÏ¢¿É²Î¿¼¡¶Windows ͼÐαà³Ì¡·µÄµÚÒ»¡¢¶þÕ¡£ÔÚWindows VistaÖУ¬Í¼ÐÎϵͳÒѾÒƳöÁËÄÚºËģʽ£¬²¢ÓÐ×Ô¼ºµÄ¿Õ¼ä ......
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections.Generic;
using System.Text;
namespace Maticsoft.DBUtility
{
/// <summary>
  ......
asp.net¼òÌå×Öת·±Ìå×ÖµÄÀà¿â
ÕⶫÎ÷ËäÈ»¼òµ¥£¬µ«Ò²²»Ê§Îª¾µäµÄÀà¿â£¬¸öÈ˶øÑÔ£¬¾Í·Ç³£Ï²»¶Õâ¸öÀà¿â¡£
ÓÃÎÄ×ּǼÏÂÀ´°É£¬Áô¸ö¼ÇÄî°É
ÔÚvsÖУ¬ÓÐÒ»¸ö¾µäµÄMicrosoft.VisualBasic.dllµÄVBÀà¿â£¬¸ù¾Ý¹Ù·½µÄÃèÊö£º
ËüÄÜÌṩ¶ÔÐí¶à .NET Framework ÀàµÄ¼òµ¥Ö±¹ÛµÄ· ......
1 ÈçºÎÔÚÌá½»ºó·ÀÖ¹µ¯³öд°¿Ú
2 ÔÚģ̬´°¿ÚÖÐÔٴε¯³öģ̬´°¿Ú
3 ģ̬´°¿Ú·µ»ØÖµ
4 ˢи¸´°¿Ú
5 ¸¸´°¿ÚÈçºÎÌí¼Óˢнű¾
Ö÷´°¿Úµ¯³öÒ»¸öģ̬´°¿Ú,
var firstDiag = window.showModalDialog(url,window,"center:yes;dialogWidth:300px;dialogHeight:400px");
×¢:ÔÚurlÎļþµÄhead¼ÓÈë <base target='_self'> ¾ ......