ASP.NET中的奇怪错误

每隔一段时间我就会在我的asp.net应用程序上得到大约10到20个相同的错误.它总是一样的,我想知道是不是有人试图入侵(它发生在一个月左右).

Source: System.Web

Message: The file ‘/~/Default.aspx’ does not exist.

User IP: 89.122.29.80

User Browser: Unknown 0.0

User OS: Unknown

Stack trace: at
System.Web.UI.Util.CheckVirtualFileExists(VirtualPath
virtualPath) at
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath
virtualPath, Boolean noBuild, Boolean
allowCrossApp, Boolean
allowBuildInPrecompile) at
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext
context, VirtualPath virtualPath,
Boolean noBuild, Boolean
allowCrossApp, Boolean
allowBuildInPrecompile) at
System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath
virtualPath, HttpContext context,
Boolean allowCrossApp, Boolean
noAssert) at
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath
virtualPath, Type requiredBaseType,
HttpContext context, Boolean
allowCrossApp, Boolean noAssert) at
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext
context, String requestType,
VirtualPath virtualPath, String
physicalPath) at
System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext
context, String requestType,
VirtualPath virtualPath, String
physicalPath) at
System.Web.HttpApplication.MapHttpHandler(HttpContext
context, String requestType,
VirtualPath path, String
pathTranslated, Boolean useAppConfig)
at
System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at
System.Web.HttpApplication.ExecuteStep(IExecutionStep
step, Boolean completedSynchronously)

为什么有人试图访问“/ ~/Default.aspx”?

最佳答案 如果您尝试在页面生命周期中过晚地在HyperLink控件上设置NavigateUrl,则有时会发生这种情况.生成相对URL后,请确保您没有在代码中创建HyperLink.

点赞