-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mgbbs/hidden for checkbox render mode (#13014)
* Added CheckBoxHiddenInputRenderMode to HtmlHelperOptions, ViewContext, and html/tag helpers Fixes #12833
- Loading branch information
Showing
8 changed files
with
407 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/Mvc/Mvc.ViewFeatures/src/Rendering/CheckBoxHiddenInputRenderMode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
namespace Microsoft.AspNetCore.Mvc.Rendering | ||
{ | ||
/// <summary> | ||
/// Controls the rendering of hidden input fields when using CheckBox tag helpers or html helpers. | ||
/// </summary> | ||
public enum CheckBoxHiddenInputRenderMode | ||
{ | ||
/// <summary> | ||
/// Hidden input fields will not be automatically rendered. If checkbox is not checked, no value will be posted. | ||
/// </summary> | ||
None = 0, | ||
|
||
/// <summary> | ||
/// Hidden input fields will be rendered inline with each checkbox. Use this for legacy ASP.NET MVC behavior. | ||
/// </summary> | ||
Inline = 1, | ||
|
||
/// <summary> | ||
/// Hidden input fields will be rendered for each checkbox at the bottom of the form element. This is the preferred render method and default MVC behavior. | ||
/// If <see cref="Microsoft.AspNetCore.Mvc.ViewFeatures.FormContext.CanRenderAtEndOfForm"/> is <c>false</c>, will fall back on <see cref="Inline"/>. | ||
/// </summary> | ||
EndOfForm = 2 | ||
} | ||
} |
Oops, something went wrong.
90e89e9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ Mgbbs thank you for doing this! Do you have insight on how to implement it? I haven't been able to find any documentation regarding this feature, and I'm not able to make sense out of what you wrote (totally on me, btw) to understand how to implement it. Thanks!