배경 : VB.NET 백엔드가있는 ASP.NET Webforms 응용 프로그램.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 행 사이에 빈 줄을 추가하십시오. 그러면 나중에 다시 나타납니다.
이 문제의 원인은 무엇일까요?
이 때문에 기존의 학교 <이 될 수 없습니다! - 스크립트 태그 안에? 나는 그것을 제거하고 IDE가 더 행복해졌으며 더 이상 오류가 발생하지 않는다. –
dgarbacz