Activities of "liangshiwei"

Hi,

Unfortunately, there is no such feature at the moment; our repository is internal.

The PR has been merged. You should see it in the next update

Hi,

I am using the latest template and don't have this problem.

See https://learn.microsoft.com/en-us/aspnet/core/mvc/views/partial?view=aspnetcore-9.0

A partial view is a Razor markup file (.cshtml) without a @page directive that renders HTML output within another markup file's rendered output.

HI,

Try remove @page from First and Second Page

Hi,

I didn't find a standard way to solve this. you can see even Microsoft's examples are using httpContextAccessor.

https://github.com/dotnet/blazor-samples/blob/main/9.0/BlazorWebAppOidcBff/BlazorWebAppOidc/ServerWeatherForecaster.cs#L11

We need to wait for the Azure SignalR team to provide a better explanation.

https://github.com/dotnet/AspNetCore.Docs/issues/13508

you can try this as a temporary solution:

public class AzureSignalRCookieService : ISingletonDependency
{
    public string Cookies { get; set; }
}

[Dependency(ReplaceServices = true)]
public class MyBlazorServerLookupApiRequestService : ILookupApiRequestService, ITransientDependency
{
    public IHttpClientFactory HttpClientFactory { get; }
    public IRemoteServiceHttpClientAuthenticator HttpClientAuthenticator { get; }
    public IRemoteServiceConfigurationProvider RemoteServiceConfigurationProvider { get; }
    public ICurrentTenant CurrentTenant { get; }
    public IHttpContextAccessor HttpContextAccessor { get; }
    public NavigationManager NavigationManager { get; }
    
    public AzureSignalRCookieService SignalRCookieService { get; }
    
    public MyBlazorServerLookupApiRequestService(IHttpClientFactory httpClientFactory,
        IRemoteServiceHttpClientAuthenticator httpClientAuthenticator,
        ICurrentTenant currentTenant,
        IHttpContextAccessor httpContextAccessor,
        NavigationManager navigationManager,
        IRemoteServiceConfigurationProvider remoteServiceConfigurationProvider,
        AzureSignalRCookieService signalRCookieService)
    {
        HttpClientFactory = httpClientFactory;
        HttpClientAuthenticator = httpClientAuthenticator;
        CurrentTenant = currentTenant;
        HttpContextAccessor = httpContextAccessor;
        NavigationManager = navigationManager;
        RemoteServiceConfigurationProvider = remoteServiceConfigurationProvider;
        SignalRCookieService = signalRCookieService;
    }

    public async Task<string> SendAsync(string url)
    {
        var client = HttpClientFactory.CreateClient(nameof(BlazorServerLookupApiRequestService));
        var requestMessage = new HttpRequestMessage(HttpMethod.Get, url);

        var uri = new Uri(url, UriKind.RelativeOrAbsolute);
        if (!uri.IsAbsoluteUri)
        {
            var remoteServiceConfig = await RemoteServiceConfigurationProvider.GetConfigurationOrDefaultOrNullAsync("Default");
            if (remoteServiceConfig != null)
            {
                // Blazor tiered mode
                var baseUrl = remoteServiceConfig.BaseUrl;
                client.BaseAddress = new Uri(baseUrl);
                AddHeaders(requestMessage);
                await HttpClientAuthenticator.Authenticate(new RemoteServiceHttpClientAuthenticateContext(client, requestMessage, new RemoteServiceConfiguration(baseUrl), string.Empty));
            }
            else
            {
                // Blazor server  mode
                client.BaseAddress = new Uri(NavigationManager.BaseUri);
                var request = HttpContextAccessor.HttpContext?.Request;
                if (request != null)
                {
                    foreach (var header in HttpContextAccessor.HttpContext!.Request.Headers)
                    {
                        requestMessage.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray());
                    }
                }
                else
                {
                    requestMessage.Headers.TryAddWithoutValidation("Cookie", SignalRCookieService.Cookies);
                }
            }
        }

        var response = await client.SendAsync(requestMessage);
        return await response.Content.ReadAsStringAsync();
    }

    protected virtual void AddHeaders(HttpRequestMessage requestMessage)
    {
        if (CurrentTenant.Id.HasValue)
        {
            requestMessage.Headers.Add(TenantResolverConsts.DefaultTenantKey, CurrentTenant.Id.Value.ToString());
        }

        var currentCulture = CultureInfo.CurrentUICulture.Name ?? CultureInfo.CurrentCulture.Name;
        if (!currentCulture.IsNullOrEmpty())
        {
            requestMessage.Headers.AcceptLanguage.Add(new(currentCulture));
        }
    }
}
app.Use((httpContext, next) =>
{
    httpContext.RequestServices.GetRequiredService<AzureSignalRCookieService>().Cookies = httpContext.Request.Cookies.Select(x => $"{x.Key}={x.Value}").JoinAsString("; ");
    return next();
});

Hi,

can you describe it in detail?

thanks.

https://github.com/abpframework/abp/issues/21915

Hi,

This is reasonable, we will fix it. your ticket was refunded.

Hi,

It seems like a problem, I will check it.

Hi @leeneshk

Can you send an email to info@abp.io and support@abp.io

Showing 201 to 210 of 6693 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on November 04, 2025, 06:41