Skip to content

Commit ec7ad9d

Browse files
committed
Use selected conditionally.
1 parent 0108ac8 commit ec7ad9d

File tree

1 file changed

+8
-17
lines changed
  • src/Geta.NotFoundHandler.Admin/Areas/GetaNotFoundHandlerAdmin/Pages

1 file changed

+8
-17
lines changed

src/Geta.NotFoundHandler.Admin/Areas/GetaNotFoundHandlerAdmin/Pages/Index.cshtml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,14 @@
4949
</td>
5050
<td>
5151
<select class="form-select" asp-for="CustomRedirect.RedirectType">
52-
@if (Options.Value.DefaultRedirectType == RedirectType.Temporary)
53-
{
54-
<option selected value="@RedirectType.Temporary">@RedirectType.Temporary</option>
55-
}
56-
else
57-
{
58-
<option value="@RedirectType.Temporary">@RedirectType.Temporary</option>
59-
}
60-
61-
@if (Options.Value.DefaultRedirectType == RedirectType.Permanent)
62-
{
63-
<option selected value="@RedirectType.Permanent">@RedirectType.Permanent</option>
64-
}
65-
else
66-
{
67-
<option value="@RedirectType.Permanent">@RedirectType.Permanent</option>
68-
}
52+
<option value="@RedirectType.Temporary"
53+
selected="@(Options.Value.DefaultRedirectType == RedirectType.Temporary)">
54+
@RedirectType.Temporary
55+
</option>
56+
<option value="@RedirectType.Permanent"
57+
selected="@(Options.Value.DefaultRedirectType == RedirectType.Permanent)">
58+
@RedirectType.Permanent
59+
</option>
6960
</select>
7061
</td>
7162
<td>

0 commit comments

Comments
 (0)