79557742

Date: 2025-04-06 02:47:37
Score: 0.5
Natty:
Report link

The issue is definetely in a layout of a view, that I'm trying to put inside modal-body cause when layout is set to null, it's working as expected.

But in this case there is another issue. When client validation is kicked in, layout turns into real null. It's just a white screen.

Here is a quick video https://drive.google.com/file/d/1U1uXD0BAugTMked-5jqZ4L4I-90dmfy8/view?usp=sharing

I need to solve either the first or the second problem.

@model SetViewModel

@{
    Layout = null;
}

<form asp-area="Sets" asp-controller="Home" asp-action="AddOrEditSet" method="post">

    <input asp-for="UserId" hidden />
    <input asp-for="Id" hidden />

    <div class="border p-3 mt-4">

        <div class="input-group mb-3 row">
            <label asp-for="Name" class="input-group-text text-light bg-dark"></label>
            <input asp-for="Name" class="form-control text-light bg-dark">
            <span asp-validation-for="Name" class="text-danger mt-2"></span>
        </div>

        <div class="row">
            <div class="col-5 m-auto">
                @if (Model.Id == 0)
                {
                    <button type="submit" class="m-auto btn btn-primary form-control border-black border-1 text-white">Create set</button>
                }
                else
                {
                    <button type="submit" class="m-auto btn btn-primary form-control border-black border-1 text-white">Update set</button>
                }
                
            </div>
        </div>
    </div>
</form>
Reasons:
  • Blacklisted phrase (0.5): I need
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: 2033