ASP.NET 中的奇怪错误

Cha*_*ell 5 asp.net

每隔一段时间,我就会在我的 asp.net 应用程序上收到大约 10 - 20 个相同的错误。总是一样的,我想知道是否有人试图入侵(这种情况大约每月发生一次)。

来源: System.Web

消息:文件“/~/Default.aspx”不存在。

用户IP: 89.122.29.80

用户浏览器:未知 0.0

用户操作系统:未知

堆栈跟踪: 在 System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) 在 System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowedCrossApp, Boolean allowedBuildInPrecompile) 在 System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert (HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowedCrossApp, Boolean allowedBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowedCrossApp, Boolean noAssert) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath( VirtualPath virtualPath,类型 requiredBaseType,HttpContext 上下文,布尔值allowCrossApp,布尔值noAssert)在System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext上下文,字符串requestType,VirtualPath virtualPath,字符串physicalPath)在System.Web.UI.PageHandlerFactory.System.Web .IHttpHandlerFactory2.GetHandler(HttpContext上下文,字符串requestType,VirtualPath virtualPath,字符串physicalPath)在System.Web.HttpApplication.MapHttpHandler(HttpContext上下文,字符串requestType,VirtualPath路径,字符串pathTranslated,布尔useAppConfig)在System.Web.HttpApplication.MapHandlerExecutionStep。 System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep 步骤,布尔值已同步完成)

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

Dan*_*son 2

如果您在页面生命周期中太晚尝试在 HyperLink 控件上设置 NavigateUrl,有时会发生这种情况。确保生成相对 URL 后,您没有在后面的代码中创建超链接。