asp.net – VirtualPath位于当前应用程序根目录之外
背景:
我刚刚从Visual Studio 2010升级到Visual Studio 2013和.NET 4.5.1。这段代码以前工作,因为我们在Visual Studio 2005和.NET 2.0。但自从升级我得到这个错误。 在ASCX用户控制中。 <script language="javascript" type="text/javascript"> <!-- function SetItem_<%Response.Write(m_strJSAlias)%>(strValue) { $("#<%Response.Write(txtShop.ClientID)%>").attr('value',strValue); __doPostBack('frmCorpPortal_Form',''); void FocusOnNext_<%response.Write(m_strJSAlias)%>; } 我们现在得到这个错误,我们从来没有得到: VirtualPath was outside the current application root. Parameter name: virtualPath Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: VirtualPath was outside the current application root. Parameter name: virtualPath Line 4: <script language="javascript" type="text/javascript"> Line 5: <!-- Line 6: function SetItem_<%Response.Write(m_strJSAlias)%>(strValue) { Line 7: $("#<%Response.Write(txtShop.ClientID)%>").attr('value',strValue); Line 8: __doPostBack('frmCorpPortal_Form',''); 如果我玩的文件,并进行无意义的更改,错误消失。示例:在第4行和第5行之间添加空行。然后稍后再返回。 可能是什么原因? 解决方法我有一个旧的应用程序在iis和从visual studio运行时的相同的问题。禁用浏览器链接在visual studio 2013似乎修复这个。这个功能注入一些javascript到您的页面,并导致这个问题为我至少。因为我禁用它现在它在IIS和Visual Studio工作。http://techatplay.wordpress.com/2013/10/24/vs2013-asp-net-application-error-virtualpath-was-outside-the-current-application-root/ 这里有关于功能的更多细节 http://blogs.msdn.com/b/webdev/archive/2013/06/28/browser-link-feature-in-visual-studio-preview-2013.aspx 干杯,Crocked (编辑:大庆站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- 运行命令(CMD)大全
- ASP.NET Webdeploy失败;项目中不存在AddScheduledJob
- asp.net 无刷新分页实例代码
- asp.net-web-api – ASP身份OAuth令牌 – 我应该在移动应用
- ASP.NET 5,.NET Core和ASP.NET Core 5有什么区别?
- asp.net-mvc – 存储库与DAL中的服务模式:EF和Dapper
- ASP.NET Core知多少(7):对重复编译说NO -- dotnet watch
- asp.net-core – 我为什么要选择带有.Net核心的ASP.NET Cor
- asp.net-mvc-3 – 在MVC3中使用Html.LabelFor的表单标签中的
- 我可以使用ASP.NET成员身份实体框架吗?
- asp.net-mvc – ASP.Net MVC – HTTP状态代码(即
- 实体框架 – 等同于.HasOptional在实体框架核心1
- asp.net-mvc-3 – MVC3视图继承不可能?
- asp.net-mvc – ActionResult上的自定义属性
- 我可以使用ASP.NET成员身份实体框架吗?
- asp.net-web-api – ASP身份OAuth令牌 – 我应该
- asp.net – 我们可以在视图状态中放置哪些类型的
- asp.net-mvc – ASP.NET MVC中的WebApi [FromUri
- asp.net – Intranet / Internet的Windows身份验
- asp.net-mvc – AppDomain.GetAssemblies和Build