I am writing to request assistance with an issue I am experiencing with an application that I have deployed to IIS under a subfolder. Specifically, I am encountering problems with the application's routing configuration, which is causing the application to lose the subfolder and display incorrect paths when using HTML or Navigation Manager.
NavigationManager.NavigateTo($"/log-details/{input.Id}", forceLoad: false);
``` @if (!CurrentUser.IsAuthenticated)
{
<a href= "../Account/Login" class="btn btn-primary mb-1">
@L["Login"]
</a>
}
When I click on menu items, the routing works correctly and includes the subfolder (e.g., localhost/test/account/login), but when using HTML or Navigation Manager, the subfolder is lost, and the path becomes incorrect (e.g., localhost/account/login).
I suspect that this issue is related to the routing configuration not being correctly set up to handle subfolders. However, I am not sure how to resolve this problem.
Here is some information about my setup:
- ABP Framework version: v7.0.1
- UI type:Blazor
- DB provider: EF Core
Thank you for your help.
4 Answer(s)
-
0
hi
Can you try to remove
/
?NavigationManager.NavigateTo($"log-details/{input.Id}", forceLoad: false);
-
0
That seems to help, I also had to remove it from generated code by the template, like here
private async Task DownloadAsExcelAsync() { var token = (await AcquisitionsAccountsAppService.GetDownloadTokenAsync()).Token; NavigationManager.NavigateTo($"/api/app/acquisitions-accounts/as-excel-file?DownloadToken= {token}&FilterText={Filter.FilterText}", forceLoad: true); }
However, there are still some instances when it breaks. When I click Sign Out, it sends me to a page without the subfolder like this
http://localhost/?page=%2FAccount%2F~%2FAccount%2FLogin
Also, I still do not have a solution for
@if (!CurrentUser.IsAuthenticated) { <a href= "../Account/Login" class="btn btn-primary mb-1"> @L["Login"] </a> }
I tried adding a button to with a click event
NavigationManager.NavigateTo("Account/Login", forceLoad: false);
but gives me a 404
Any ideas?
-
0
I will check all redirects in commercial modules.
-
0