Open Closed

Show manage profile page in same page without open in new tab #3146


User avatar
0
safi created

Hi

Can we show manage profile page in same page without show in new tab. Please see the below screenshot for the same.

  • ABP Framework version: v4.4.3
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

2 Answer(s)
  • User Avatar
    0
    berkansasmaz created
    Support Team .NET Developer

    I think you can do it by changing the target.

    In the *.MenuContributor.cs class inside the Navigation folder, you can change the target in the ConfigureUserMenuAsync method as follows:

    private async Task ConfigureUserMenuAsync(MenuConfigurationContext context)
            {
                var accountStringLocalizer = context.GetLocalizer<AccountResource>();
                var identityServerUrl = _configuration["AuthServer:Authority"] ?? "";
    
                context.Menu.AddItem(new ApplicationMenuItem(
                    "Account.Manage",
                    accountStringLocalizer["MyAccount"],
                    $"{identityServerUrl.EnsureEndsWith('/')}Account/Manage?returnUrl={_configuration["App:SelfUrl"]}",
                    icon: "fa fa-cog",
                    order: 1000,
                    customData: null,
                    target: "_self"
                    ).RequireAuthenticated());
    
                context.Menu.AddItem(new ApplicationMenuItem(
                    "Account.SecurityLogs",
                    accountStringLocalizer["MySecurityLogs"],
                    $"{identityServerUrl.EnsureEndsWith('/')}Account/SecurityLogs?returnUrl={_configuration["App:SelfUrl"]}",
                    icon: "fa fa-cog",
                    order: 1001,
                    null).RequireAuthenticated());
    
                await Task.CompletedTask;
            }
        }
    
  • User Avatar
    0
    safi created

    I think you can do it by changing the target.

    In the *.MenuContributor.cs class inside the Navigation folder, you can change the target in the ConfigureUserMenuAsync method as follows:

    private async Task ConfigureUserMenuAsync(MenuConfigurationContext context) 
            { 
                var accountStringLocalizer = context.GetLocalizer<AccountResource>(); 
                var identityServerUrl = _configuration["AuthServer:Authority"] ?? ""; 
     
                context.Menu.AddItem(new ApplicationMenuItem( 
                    "Account.Manage", 
                    accountStringLocalizer["MyAccount"], 
                    $"{identityServerUrl.EnsureEndsWith('/')}Account/Manage?returnUrl={_configuration["App:SelfUrl"]}", 
                    icon: "fa fa-cog", 
                    order: 1000, 
                    customData: null, 
                    target: "_self" 
                    ).RequireAuthenticated()); 
     
                context.Menu.AddItem(new ApplicationMenuItem( 
                    "Account.SecurityLogs", 
                    accountStringLocalizer["MySecurityLogs"], 
                    $"{identityServerUrl.EnsureEndsWith('/')}Account/SecurityLogs?returnUrl={_configuration["App:SelfUrl"]}", 
                    icon: "fa fa-cog", 
                    order: 1001, 
                    null).RequireAuthenticated()); 
     
                await Task.CompletedTask; 
            } 
        } 
    

    Thanks working fine.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11