ASP.NETµÄ´íÎó´¦Àí»úÖÆ
¶ÔWebÓ¦ÓóÌÐòÀ´Ëµ£¬·¢Éú²»¿ÉÔ¤ÖªµÄ´íÎóºÍÒì³£ÔÚËùÄÑÃ⣬ÎÒÃDZØÐëΪWeb³ÌÐòÌṩ´íÎó´¦Àí»úÖÆ¡£µ±´íÎó·¢Éúʱ£¬ÎÒÃDZØÐë×öºÃÁ½¼þÊÂÇ飺һÊǽ«´íÎóÐÅÏ¢¼Ç¼ÈÕÖ¾£¬·¢Óʼþ֪ͨÍøվά»¤ÈËÔ±£¬·½±ã¼¼ÊõÈËÔ±¶Ô´íÎó½øÐиú×Ù´¦Àí£»
¶þÊÇÒÔÓѺõķ½Ê½Ìáʾ×îÖÕÓû§Ò³Ãæ·¢ÉúÁË´íÎ󣬶ø²»Äܽ«Î´´¦ÀíµÄ´íÎóÐÅÏ¢ÏÔʾ¸øÓû§¡£
ÈÃÎÒÃÇÏëÏ룬ASP.NETΪÎÒÃÇÌṩÁ˼¸ÖÖ´íÎó´¦Àí»úÖÆ£¿Èç¹ûͬʱʹÓÃËûÃÇÊDz»ÊÇÓÐÒ»¶¨µÄÓÅÏȼ¶£¿.NETÌṩÁËËÄÖÖ´íÎó´¦Àí»úÖÆ£¬ËüÃÇÓÐÒ»¶¨µÄÓÅÏȼ¶
˳Ðò£ºPage_Errorʼþ >
ErrorPageÊôÐÔ >
Application_Errorʼþ >
<customErrors>ÅäÖÃÏî
¡£ÏÂÃæ·Ö±ð½éÉÜÕâËÄÖÖ´íÎó´¦Àí»úÖƵÄÓ÷¨¡£
1.Page_Error
ʼþ
Page_Error
ʼþÌṩһÖÖ²¶»ñÔÚÒ³¼¶±ð³öÏֵĴíÎóµÄ·½·¨¡£Äú¿ÉÒÔÖ»ÊÇÏÔʾ´íÎóÐÅÏ¢£¨ÕýÈçÏÂÃæµÄʾÀý´úÂëËùʾ£©£¬Ò²¿ÉÒԼǼʼþ»òÖ´ÐÐij¸öÆäËû²Ù×÷¡£
private
void
Page_Load(
object
sender, System.EventArgs e)
{
//
Put user code to initialize the page here
throw
new
Exception(
"
Page Error!
"
);
}
protected
void
Page_Error(
object
sender, EventArgs e)
{
Exception objErr
=
Server.GetLastError().GetBaseException();
Response.Write(
"
Error:
"
+
objErr.Message);
Server.ClearError();
//
ͬÑùҪעÒâÕâ¾ä´úÂëµÄʹÓÃ
}
±¸×¢
£º´ËʾÀýÔÚä¯ÀÀÆ÷ÖÐÏÔʾÏêϸµÄ´íÎóÐÅÏ¢£¬Ìṩ´ËʾÀýÖ»ÊÇΪÁ˽øÐÐ˵Ã÷¡£ÏòÓ¦ÓóÌÐòµÄ×îÖÕÓû§ÏÔʾÏê
ϸÐÅÏ¢Ò»¶¨ÒªÐ¡ÐÄ¡£¸üÊʵ±µÄ×ö·¨ÊÇÏòÓû§ÏÔʾһÌõÏûÏ¢£¬¸æÖªÒÑ·¢Éú´íÎó£¬È»ºó
Ïà¹ØÎĵµ£º
Ò»¡¢´´½¨Îļþ¼Ð
#region ´´½¨Îļþ¼Ð
/// <summary>
/// Self_Function:´´½¨Îļþ¼Ð
/// </summary>
/// <param name="path">´´½¨Îļþ¼ÐµÄ·¾¶</param>
/// <param name="noyes">Òþ²ØÎ ......
WebÀï¼ÓÈë<sessionState cookieless="false" mode="StateServer" timeout="60" stateNetworkTimeout="3600" sqlCommandTimeout="3600"/>ºó±ØÐ루cmdÀïÔËÐÐ:Net Start aspnet_state£©²Å¿ÉÒÔÉèÖÃsessionÖµ¡£
ÕâÒ»¶Î¾ÍÊÇÅäÖÃÓ¦ÓóÌÐòÊÇÈçºÎ´æ´¢SessionÐÅÏ¢µÄÁË¡£ÎÒÃÇÒÔϵĸ÷ÖÖ²Ù×÷Ö÷ÒªÊÇÕë¶ÔÕâÒ»¶ÎÅäÖÃÕ¹ ......
SQL½Å±¾£º
CREATE TABLE tblBooksUpload
(
¡¡DocID int NOT NULL IDENTITY Primary Key ,
¡¡DocTitle varchar (200) ,
¡¡Doc image,
¡¡DocType varchar (50) ,
¡¡Entrydate datetime Default GetDate()
)
Ê×ÏÈÎÒÃÇҪʵÏÖÓû§ÔÚä¯ÀÀÆ÷¶Ë×ÔÓÉÑ¡ÔñÎļþ£¬È»ºóÉÏ´«£¬ÕâÀïÓû§Ñ¡ÔñÎļþ£¬µ±È»ÊÇÒªÇó±ê×¼µÄWindows·½Ê½£ ......
ÔÚasp.net ʹÓÃÊý¾Ý¼¯Éè¼ÆÆ÷ ·ÃÎÊÊý¾ÝÖÐ˵¹ý£¬ÒªÊ¹Insert,Update,Delete²éѯ¿ÉÓ㬱ØÐëɾ³ýObjectDataSource¶ÔÏó
ÊôÐÔDataObjectTypeNameµÄÖµ¡£ÏÂÃæҪ˵µÄÊÇ£¬ÔÚ²»É¾³ý¸ÃÖµÏÂʹ²éѯ¿ÉÓõķ½·¨¡££¨ÓÉÓÚ֮ǰÔÚɾ³ý
DataObjectTypeNameºóInsert,Update,Delete²éѯһֱµ÷ÊÔ²»³É¹¦£¬ÓÚÊǵ®ÉúÁËÈçÏÂʹÓ÷½·¨¡££©
Óëasp.net Ê¹Ó ......
/// <summary>
/// дCookies
/// </summary>
/// <param name="response"></param>
/// <param name="request"></param>
&n ......