ASP.NET×Ô¶¨Òå´íÎóÒ³Ãæ
ASP.NET ÌṩÈýÖÖÓÃÓÚÔÚ³öÏÖ´íÎóʱ²¶»ñºÍÏìÓ¦´íÎóµÄÖ÷Òª·½·¨£ºPage_Error ʼþ¡¢Application_Error ʼþÒÔ¼°Ó¦ÓóÌÐòÅäÖÃÎļþ (Web.config)¡£
Èç¹ûÄú²»µ÷Óà Server.ClearError »òÕß²¶»ñ Page_Error »ò Application_Error ʼþÖеĴíÎó£¬Ôò½«¸ù¾Ý Web.config ÎļþµÄ <customErrors> ²¿·ÖÖеÄÉèÖô¦Àí´íÎó¡£ÔÚ <customErrors> ²¿·Ö£¬¿É½«Öض¨ÏòÒ³Ö¸¶¨ÎªÄ¬ÈϵĴíÎóÒ³ (defaultRedirect) »òÕ߸ù¾ÝÒý·¢µÄ HTTP ´íÎó´úÂëÖ¸¶¨Ìض¨Ò³¡£Äú¿ÉʹÓô˷½·¨×Ô¶¨ÒåÓû§ÊÕµ½µÄ´íÎóÐÅÏ¢¡£
¾¡¹ÜÄú¿ÉÔÚ <customErrors> ²¿·ÖÖÐ defaultRedirect ÊôÐÔµÄÖµÖÐÒýÓÃĬÈϵĴíÎóÒ³£¬µ«ÊÇÄú»¹¿É¸ù¾ÝÒý·¢µÄ HTTP ´íÎó´úÂëÖ¸¶¨ÒªÖض¨Ïòµ½µÄÌØ¶¨Ò³¡£<error> ×ÓÔªËØÔÊÐíʹÓôËÑ¡Ïî
<customErrors mode="On" defaultRedirect="ApplicationErroy.aspx">
<error statusCode="403" redirect="403.htm"/>
<error statusCode="404" redirect="404.htm"/>
<error statusCode="500" redirect="500.htm"/>
</customErrors>
asp.net×Ô¶¨Òå´íÎó´¦ÀíÒ³Ãæ·½·¨Ò»
1¡¢Ìí¼ÓWeb.config£¬ < system.web>< /system.web>ÖÐÌí¼Ó< customErrors mode="On"
defaultRedirect="ApplicationErroy.aspx" >< /customErrors>½Úµã£¬
2¡¢Ìí¼Ó´íÎó´¦ÀíÒ³Ãæ£ºApplicationErroy.aspxµ÷ÓÃÏÂÃæµÄ·½·¨£º
private void DealErroy()
{
HttpException erroy = new HttpException();
string strCode = erroy.ErrorCode.ToString();
string strMsg = erroy.Message;
erroy.HelpLink = "sss";
Response.Write("ErrorCode:" + strCode + "< br>");
Response.Write("Message:" + strMsg + "< br>");
Ïà¹ØÎĵµ£º
Internet Àà
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Net;
using System.IO;
using System.Text.RegularExpressions;
using System.Threading;
namespace DownData
{
class internet
{
&nb ......
1.Response.Redirect("http://www.jb51.net",false);
Ä¿±êÒ³ÃæºÍÔÒ³Ãæ¿ÉÒÔÔÚ2¸ö·þÎñÆ÷ÉÏ£¬¿ÉÊäÈëÍøÖ·»òÏà¶Ô·¾¶¡£ºóÃæµÄboolֵΪÊÇ·ñÍ£Ö¹Ö´Ðе±Ç°Ò³¡£
Ìø×ªÏòеÄÒ³Ãæ£¬Ô´°¿Ú±»´úÌæ¡£"
ä¯ÀÀÆ÷ÖеÄURLΪз¾¶¡£
:Response.Redirect·½·¨µ¼ÖÂä¯ÀÀÆ÷Á´½Óµ½Ò»¸öÖ¸¶¨µÄURL¡£µ±Response.Redirect()·½·¨± ......
WCFµÄ¼Ü¹¹£ºusing System.ServiceModel;
ÆõÔ¼:Contract
[ServiceContract]
public partial interface IContract
{
[OperationContract]
string DocumentWebHostUrl();
}
·þÎñ£ºService
[ServiceBehavior(IncludeException ......
Asp.net¿Ø¼þ£¨°üÀ¨Web·þÎñÆ÷¿Ø¼þºÍHtml·þÎñÆ÷¿Ø¼þ£©¶¼Ã»ÓÐË«»÷ʼþ£¬ÄÇô¸ÃÈçºÎ½«Ë«»÷ʼþ¸¶¸øAsp.Net¿Ø¼þÄØ£¿ÎÒÃÇÒÔLable¿Ø¼þΪÀý¡£
Ò»¡¢Ê×ÏȼÓÈë¿Ø¼þ£¬IDΪLable1£¬È»ºó¼ÓÈëÒ»¸öButton¿Ø¼þ£¬IDΪButton1£¬´úÂëÈçÏÂ
& ......
Parameter Queries in ASP.NET with MS Access
A selection of code samples for executing queries against MS Access using parameters.
Making use of the ASP.NET 2.0 datasource controls is fine, but it is important to understand how to manually create data access code. Best practice dictates that, at t ......