Код: Выделить всё
Areas => Identity => Pages => Account => RegisterOptions.cshtml
В Views/Shared/_Layout.cshtml:
Код: Выделить всё
POS Software
@if (User.Identity.IsAuthenticated)
{
@* Main Body Start *@
@RenderBody()
@* Main Body End *@
}
else
{
@await Html.PartialAsync("~/Areas/Identity/Pages/Account/RegisterOptions.cshtml")
}
@await RenderSectionAsync("Scripts", required: false)
Код: Выделить всё
@using POS_Software
@using POS.Models
@using POS.Utility
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
Код: Выделить всё
@page
@model RegisterOptionsModel
@{
ViewData["Title"] = "Choose Registration Type";
}
Welcome to POS Software
[i][/i]
Manager
For Manager
Manage operations and oversee transactions for the POS system.
Login
Don't have an account? Sign Up
[i][/i]
Cashier
For Cashier
Process transactions and manage sales efficiently in the POS system.
Login
Don't have an account? Sign Up
Код: Выделить всё
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace POS_Software.Areas.Identity.Pages.Account
{
public class RegisterOptionsModel : PageModel
{
public void OnGet()
{
}
}
}
Код: Выделить всё
@using Microsoft.AspNetCore.Identity
@using POS.Models
@using POS.Utility
@using POS_Software.Areas.Identity
@using POS_Software.Areas.Identity.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
При обработке запроса произошло необработанное исключение.
NullReferenceException: ссылка на объект не установлена на экземпляр объекта.
AspNetCoreGeneratedDocument.Areas_Identity_Pages_Account_RegisterOptions.ExecuteAsync() в RegisterOptions.cshtml, строка 4
Ожидание: я просто хочу, чтобы мне не нужно было добавлять эту навигационную панель, боковую панель и нижний колонтитул в RegisterOptions.cshtml, они будут отделены от дизайна главной страницы до успешного входа в систему или регистрация.
Подробнее здесь: https://stackoverflow.com/questions/791 ... -object-in