Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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 Ò³Ã澲̬»¯·½°¸

ÔÚ×î½üµÄÓÃasp.net ¿ª·¢µÄÏîÄ¿ÖУ¬×öÓÅ»¯£¬Òª°ÑÒ³Ã澲̬»¯£¬²éÁ˺ܶàÖÖ·½·¨£¬×îºóÑ¡ÔñÁËÓÃÄ£°åÀ´ÊµÏÖ£¬
×îÖÕÒ³µÄʵÏֱȽϼòµ¥£¬ÔÚÍøÉÏÕÒÁËÒ»¶Î´úÂ룬µ«Ê×Ò³£¬¶þ¼¶Ò³£¬ÁбíÒ³µÄ´¦Àí±¾ÈËÊÇÓõÄÒÔÏ·½°¸£¬ÏÖÔÚ»¹Ö»ÊÇÒ»¸ö±È½Ï¼òµ¥µÄ£¬Ï£ÍûÓдó¼Ò¶à¶àÖ¸µã£¬½»Á÷£»
·½·¨ÈçÏ£º
   ˼·ÃèÊö£º
    1£ ......

ASP.NET´ÓSQL ServerÊý¾Ý¿âÌáȡͼƬ²¢ÏÔʾÔÚDataGrid

ʹÓÃGridview°ó¶¨Êý¾Ý¿âÖеÄͼƬ(תÔØ)
×¢£º´ËϵÁмǼÔÚÎÒʵ¼Ê¿ª·¢ÖÐÓöµ½µÄÎÊÌâºÍÊÕ²ØһЩ¼¼ÇÉÎÄÕ¡£
ÎÒÃǶ¼ÖªµÀ£¬ÔÚGridviewÖв»ÄÜÖ±½ÓÈ¥°ó¶¨Êý¾Ý¿âÖеÄͼƬ£¬ÎÒÃÇ¿ÉÒÔÀûÓÃHttpHandlerºÜÈÝÒ×µÄÍê³ÉÕâ¸öÈÎÎñ£¬ÔÚÕâÀïÎҼǼһÏÂÕâ¸ö¹ý³Ì¡£
1.ÉÏ´«Í¼Æ¬´æ´¢µ½Êý¾Ý¿âÖÐ
ÔÚÊý¾Ý¿âÖд´½¨Ò»¸ö±í£¬Ìí¼ÓÒ»ÏÂ3¸ö×ֶΣº
²½ÖèÒ»£ ......

ASP.NET³£ÓôúÂë

http://www.chinaz.com/Program/.NET/101U1142006.html
¡¡¡¡1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
´«ËͲÎÊý£º
response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')</script>")
½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QuerySt ......

ASP.NETÖг£ÓõÄÈýÊ®ÈýÖÖ´úÂë


 1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
´«ËͲÎÊý£º
response.write("£¼script£¾window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')£¼/script£¾")
½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1.Attribute ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ