The following error message is displayed:
============================
The specified parameter has exceeded the valid value range. Parameter Name: Date
Note:An error occurred while executing the current Web request. Check the stack trace information for details about the error and the source of the error in the code.
Exception details:System. argumentoutofrangeexception: the specified parameter has exceeded the valid value range. Parameter Name: Date
Source error:
An unhandled exception is generated during the execution of the current Web request. You can use the following exception stack trace information to determine the cause and location of the exception. |
Stack trace:
[Argumentoutofrangeexception: the specified parameter has exceeded the valid value range. Parameter Name: DATE] system. web. httpcachepolicy. utcsetlastmodified (datetime utcdate) system. web. httpcachepolicy. setlastmodified (datetime date) system. web. staticfilehandler. processrequest (httpcontext context) system. web. callhandlerexecutionstep. system. web. httpapplication + iexecutionstep. execute () system. web. httpapplication. executestep (iexecutionstep step, Boolean & completedsynchronously)
|
Version:Microsoft. NET Framework Version: 1.1.4322.573; ASP. NET version: 1.1.4322.573
========================================================
The method code is as follows:
Private void context_beginrequest (Object sender, eventargs E)
{
Httpapplication application = (httpapplication) sender;
Httpcontext context = application. context;
String strurl = context. Request. rawurl; // read the request URL
String STR = simplehtmlmodule. gethtmlpage (strurl); // obtain the corresponding HTML file name
If (STR = "") // no corresponding html
{
Context. rewritepath (strurl );
Return;
}
String strfile = context. server. mappath (STR); // obtain the absolute path of HTML
If (system. Io. file. exists (strfile) // check whether the HTML file exists
{
Context. rewritepath (STR); // jump to HTML
}
Else
{
If (buildhtmlpage (strurl, strfile) // try to generate an HTML file
{
Context. rewritepath (STR); // jump to HTML
// Context. rewritepath (strurl); // The generated result is successfully redirected to the original ASPX page.
}
Else
{
Context. rewritepath ("MSG. aspx ");
Context. response. Write ("the page you accessed" + strurl + "does not exist ");
}
}
}
The problem is very strange. An error occurs when generate an HTML generate rewritepath immediately. If it is changed to the generated rewirtepath to the original aspx file, no error will occur. What's even more strange is that if you put a breakpoint for step-by-step running, the error will not exist! I use the XP system. The Code passed the test in win2003.