第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

在 ASP.NET Core Identity UI 中登錄鏈接不起作用

在 ASP.NET Core Identity UI 中登錄鏈接不起作用

C#
滄海一幻覺 2022-12-31 13:24:29
我已將我的 asp.net core 2.2 應(yīng)用程序配置為基于ASP.NET Core 項(xiàng)目中的此腳手架標(biāo)識(shí)(因此我可以自定義其外觀)腳手架標(biāo)識(shí)=>創(chuàng)建完整標(biāo)識(shí) UI 源鏈接。http : //localhost:12345/identity/account/login url 在我直接在瀏覽器中請(qǐng)求時(shí)有效,但在我將其作為主頁上的鏈接時(shí)無效。我究竟做錯(cuò)了什么?啟動(dòng).cs:public void ConfigureServices(IServiceCollection services)        {            services.Configure<CookiePolicyOptions>(options =>            {                // This lambda determines whether user consent for non-essential cookies is needed for a given request.                options.CheckConsentNeeded = context => true;                options.MinimumSameSitePolicy = SameSiteMode.None;            });            services.AddDbContext<ApplicationDbContext>(options =>                options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));            services.AddIdentity<IdentityUser, IdentityRole>()                //.AddDefaultUI(UIFramework.Bootstrap4)                .AddEntityFrameworkStores<ApplicationDbContext>();            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2).                AddRazorPagesOptions(options =>            {                options.AllowAreas = true;                options.Conventions.AuthorizeAreaFolder("Identity", "/Account/Manage");                options.Conventions.AuthorizeAreaPage("Identity", "/Account/Logout");            });            services.ConfigureApplicationCookie(options =>            {                options.LoginPath = $"/Identity/Account/Login";                options.LogoutPath = $"/Identity/Account/Logout";                options.AccessDeniedPath = $"/Identity/Account/AccessDenied";            });            services.AddSingleton<IEmailSender, EmailSender>();        }
查看完整描述

1 回答

?
鴻蒙傳說

TA貢獻(xiàn)1865條經(jīng)驗(yàn) 獲得超7個(gè)贊

有兩種方法可以做到這一點(diǎn)。


方法 1:使用href


<a href="/identity/account/login" 

    class="btn btn-sm btn-white btn-icon rounded-pill d-none d-lg-inline-flex"

    data-toggle="tooltip" data-placement="left">

    <span class="btn-inner--icon"><i class="fas fa-sign-in"></i></span>

    <span class="btn-inner--text">Login</span>

</a>

方法二:


<a asp-area="Identity"  asp-page="/Account/Login" 

    class="btn btn-sm btn-white btn-icon rounded-pill d-none d-lg-inline-flex"

    data-toggle="tooltip" data-placement="left">

    <span class="btn-inner--icon"><i class="fas fa-sign-in"></i></span>

    <span class="btn-inner--text">Login</span>

</a>


查看完整回答
反對(duì) 回復(fù) 2022-12-31
  • 1 回答
  • 0 關(guān)注
  • 90 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)