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

ASP.NET³ÌÐòÖг£ÓôúÂë»ã×Ü


ASP.NET³ÌÐòÖг£ÓôúÂë»ã×Ü
1.×Ô¶¨ÒåÒì³£´¦Àí
//×Ô¶¨ÒåÒì³£´¦ÀíÀà
using System;
using System.Diagnostics;
namespace MyAppException
{
¡¡/// £¼summary£¾
¡¡/// ´ÓϵͳÒì³£ÀàApplicationException¼Ì³ÐµÄÓ¦ÓóÌÐòÒì³£´¦ÀíÀà¡£
¡¡/// ×Ô¶¯½«Òì³£ÄÚÈݼǼµ½Windows NT/2000µÄÓ¦ÓóÌÐòÈÕÖ¾
¡¡/// £¼/summary£¾
¡¡public class AppException:System.ApplicationException
¡¡{
¡¡¡¡public AppException()
¡¡¡¡{
¡¡¡¡¡¡if (ApplicationConfiguration.EventLogEnabled)LogEvent("³öÏÖÒ»¸öδ֪´íÎó¡£");
¡¡¡¡}
¡¡public AppException(string message)
¡¡{
¡¡¡¡LogEvent(message);
¡¡}
¡¡public AppException(string message,Exception innerException)
¡¡{
¡¡¡¡LogEvent(message);
¡¡¡¡if (innerException != null)
¡¡¡¡{
¡¡¡¡¡¡LogEvent(innerException.Message);
¡¡¡¡}
¡¡}
¡¡//ÈÕÖ¾¼Ç¼Àà
¡¡using System;
¡¡using System.Configuration;
¡¡using System.Diagnostics;
¡¡using System.IO;
¡¡using System.Text;
¡¡using System.Threading;
¡¡namespace MyEventLog
¡¡{
¡¡¡¡/// £¼summary£¾
¡¡¡¡/// ʼþÈÕÖ¾¼Ç¼À࣬ÌṩʼþÈÕÖ¾¼Ç¼֧³Ö
¡¡¡¡/// £¼remarks£¾
¡¡¡¡/// ¶¨ÒåÁË4¸öÈÕÖ¾¼Ç¼·½·¨ (error, warning, info, trace)
¡¡¡¡/// £¼/remarks£¾
¡¡¡¡/// £¼/summary£¾
¡¡¡¡public class ApplicationLog
¡¡¡¡{
¡¡¡¡¡¡/// £¼summary£¾
¡¡¡¡¡¡/// ½«´íÎóÐÅÏ¢¼Ç¼µ½Win2000/NTʼþÈÕÖ¾ÖÐ
¡¡¡¡¡¡/// £¼param name="message"£¾ÐèÒª¼Ç¼µÄÎı¾ÐÅÏ¢£¼/param£¾
¡¡¡¡¡¡/// £¼/summary£¾
¡¡¡¡¡¡public static void WriteError(String message)
¡¡¡¡¡¡{
¡¡¡¡¡¡¡¡WriteLog(TraceLevel.Error, message);
¡¡¡¡¡¡}
¡¡¡¡¡¡/// £¼summary£¾
¡¡¡¡¡¡/// ½«¾¯¸æÐÅÏ¢¼Ç¼µ½Win2000/NTʼþÈÕÖ¾ÖÐ
¡¡¡¡¡¡/// £¼param name="message"£¾ÐèÒª¼Ç¼µÄÎı¾ÐÅÏ¢£¼/param£¾
¡¡¡¡¡¡/// £¼/summary£¾
¡¡¡¡¡¡public static void WriteWarning(String message)
¡¡¡¡¡¡{
¡¡¡¡¡¡¡¡WriteLog(TraceLevel.Warning, message);¡¡¡¡
¡¡¡¡¡¡}
¡¡¡¡¡¡/// £¼summary£¾
¡¡¡¡¡¡/// ½«ÌáʾÐÅÏ¢¼Ç¼µ½Win2000/NTʼþÈÕÖ¾ÖÐ
¡¡¡¡¡¡/// £¼param name="message"£¾ÐèÒª¼Ç¼µÄÎı¾ÐÅÏ¢£¼/param£¾
¡¡¡¡¡¡/// £¼/summary£¾
¡¡¡¡¡¡public static void WriteInfo(String message)
¡¡¡¡¡¡{
¡¡¡¡¡¡¡¡WriteLog(TraceLevel.Info, message);
¡¡


Ïà¹ØÎĵµ£º

Ò»¸ö¼òµ¥µÄASP.NET +ACCESS µÇ¼

Ê×Ò³£º
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head ......

How postback works in ASP.NET

Introduction
In this article, we will take a closer look at how ASP.NET pages post back to themselves, and how to customize this feature in our web applications.
function __doPostBack(eventTarget, eventArgument)
One of the most important features of the ASP.NET environment is the ability to decla ......

ÔÚASP.NETÖУ¬ÈçºÎʵÏÖµã»÷°´Å¥µ¯³öд°¿Ú.ˢи¸´°¿Ú

 a.aspx
//ÏÔʾij¸ö¶©µ¥µÄÏêϸÐÅÏ¢£¬Í¨¹ýÒ»¸öģ̬¶Ô»°¿ò£¬¶øÇÒÆÁÄ»»á±äÑÕÉ«
        function ShowOrderDetails(orderId) {
            var url = "AddMenu.aspx?ID=" + orderId;
     &n ......

ÈçºÎÔÚASP.NetºÍJavaScriptÖд«µÝÊý¾Ý

×î½üÅöµ½Ò»ÎÊÌ⣬ÐèÒªÔÚASP.NetºÍJavaScriptÖд«µÝÊý¾Ý¡£¾ßÌåµÄÐèÇóÊÇÕâÑùµÄ£¬Ò³Ãæpostbackºó½«»áload JS£¬µ«ÊÇÐèÒª¼Çס֮ǰij¸ö״̬£¬Õâ¸ö״̬ÊÇÖ¸JSµÄ״̬£¬Ò²¾ÍÊÇ˵load JSºó£¬»¹Òª¼Çס֮ǰµÄ״̬£¬¶ø²»Êǻص½Ä¬ÈϵÄ״̬¡£
Ò»¿ªÊ¼ÏëÁ˺ܶà°ì·¨£¬µ«¶¼²»³É¹¦£¬ºóÀ´ÎÊÁËÎÊͬÊ£¬·¢ÏÖ¿ÉÒÔͨ¹ýÒþ²ØµÄ±íµ¥ÔªËØÀ´´«µÝÊý¾Ý£¬ËùÒ ......

Asp.netÖ® ÀàºÍ½á¹¹µÄÇø±ð

1¡¢ÀàÊÇÒýÓÃÀàÐÍ£¬½á¹¹ÔòÊÇÖµÀàÐÍ¡£Òò´Ë½á¹¹ÊÇ·ÅÔÚÕ»£¨Stack£©ÀÀàÔò½ö½öÊǽ«ÒýÓõØÖ·´æ·ÅÔÚÕ»À¶ø¾ßÌåµÄÖµÔò´æ·ÅÔÚ¶Ñ£¨heap£©Àï¡£
2¡¢¾ÝµÚ1µã¿ÉÒԵóö½áÂÛ£¬ÄǾÍÊÇÀà¶ÔÏóͨ³£ÓÃÀ´´«µÝ´óÊý¾Ý£¬¶ø½á¹¹¶ÔÏóÔòÓÃÀ´´«µÝСÊý¾Ý¡£
3¡¢Àà¿ÉÒԼ̳кͱ»¼Ì³Ð£¬¶ø½á¹¹Ôò²»Ö§³Ö¡£µ«½á¹¹ºÍÀàÒ»Ñù¿ÉÒԼ̳Ð×Ô½Ó¿Ú¡£
4¡¢½á¹¹¶ÔÏó²»ÄÜ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ