Skip to content

Commit be16bda

Browse files
committed
resolves aspnetboilerplate/aspnetboilerplate#6053: Correctly set abp.appPath
1 parent 0103932 commit be16bda

File tree

2 files changed

+28
-15
lines changed

2 files changed

+28
-15
lines changed

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Views/Account/_Scripts.cshtml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
@using System.Globalization
22
@inject AbpCompanyName.AbpProjectName.Timing.AppTimes AppTimes
33

4-
<script type="text/javascript">
5-
// This is used to get the application's root path from javascript.
6-
// It's useful if you're running application in a virtual directory under IIS.
7-
var abp = abp || {};
8-
abp.appPath = '@ApplicationPath';
9-
</script>
104

115
<environment names="Development">
126
@*core scripts start*@
@@ -41,10 +35,23 @@
4135
@*custom scripts start*@
4236
<script src="~/js/main.js" asp-append-version="true"></script>
4337
@*custom scripts end*@
38+
39+
<script type="text/javascript">
40+
// This is used to get the application's root path from javascript.
41+
// It's useful if you're running application in a virtual directory under IIS.
42+
var abp = abp || {};
43+
abp.appPath = '@ApplicationPath';
44+
</script>
4445
</environment>
4546

4647
<environment names="Staging,Production">
4748
<script src="~/view-resources/Views/_Bundles/account-layout.min.js" asp-append-version="true"></script>
49+
<script type="text/javascript">
50+
// This is used to get the application's root path from javascript.
51+
// It's useful if you're running application in a virtual directory under IIS.
52+
var abp = abp || {};
53+
abp.appPath = '@ApplicationPath';
54+
</script>
4855
</environment>
4956

5057
@if (CultureInfo.CurrentUICulture.Name != "en")
@@ -74,4 +81,4 @@
7481

7582
<!-- Dynamic scripts of ABP system (They are created on runtime and can not be bundled) -->
7683
<script src="~/AbpServiceProxies/GetAll?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>
77-
<script src="~/AbpScripts/GetScripts?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>
84+
<script src="~/AbpScripts/GetScripts?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Views/Shared/Layout/_Scripts.cshtml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
@using System.Globalization
22
@inject AbpCompanyName.AbpProjectName.Timing.AppTimes AppTimes
33

4-
<script type="text/javascript">
5-
// This is used to get the application's root path from javascript.
6-
// It's useful if you're running application in a virtual directory under IIS.
7-
var abp = abp || {};
8-
abp.appPath = '@ApplicationPath';
9-
</script>
10-
114
<environment names="Development">
125
@*core scripts start*@
136
<script src="~/libs/jquery/jquery.js" asp-append-version="true"></script>
@@ -51,10 +44,23 @@
5144
<script src="~/js/abp.dataTable.js" asp-append-version="true"></script>
5245
<script src="~/js/main.js" asp-append-version="true"></script>
5346
@*custom scripts end*@
47+
48+
<script type="text/javascript">
49+
// This is used to get the application's root path from javascript.
50+
// It's useful if you're running application in a virtual directory under IIS.
51+
var abp = abp || {};
52+
abp.appPath = '@ApplicationPath';
53+
</script>
5454
</environment>
5555

5656
<environment names="Staging,Production">
5757
<script src="~/view-resources/Views/_Bundles/shared-layout.min.js" asp-append-version="true"></script>
58+
<script type="text/javascript">
59+
// This is used to get the application's root path from javascript.
60+
// It's useful if you're running application in a virtual directory under IIS.
61+
var abp = abp || {};
62+
abp.appPath = '@ApplicationPath';
63+
</script>
5864
</environment>
5965

6066
@if (CultureInfo.CurrentUICulture.Name != "en")
@@ -84,4 +90,4 @@
8490

8591
<!-- Dynamic scripts of ABP system (They are created on runtime and can not be bundled) -->
8692
<script src="~/AbpServiceProxies/GetAll?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>
87-
<script src="~/AbpScripts/GetScripts?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>
93+
<script src="~/AbpScripts/GetScripts?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>

0 commit comments

Comments
 (0)