-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Mgbbs/hidden for checkbox render mode #13014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
pranavkm
merged 4 commits into
dotnet:master
from
mgbbs:mgbbs/hidden-for-checkbox-render-mode
Aug 26, 2019
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5ea49eb
Added CheckBoxHiddenInputRenderMode to HtmlHelperOptions, ViewContext…
mgbbs fef24ba
CheckBoxHiddenInputRenderMode unit tests
mgbbs ff77d17
Regenerated reference assemblies
mgbbs bc585c5
Updated comment for CheckBoxHiddenInputRenderMode.EndOfForm to more s…
mgbbs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Suggest this should be in the same namespace as
HtmlHelperOptions
:Microsoft.AspNetCore.Mvc.ViewFeatures
but defer to @pranavkm hereThere 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.
Thanks for the quick response @dougbu. I initially put it in the
.Rendering
namespace to follow suit withHtml5DateRenderingMode
andTagRenderMode
, but will also defer to @pranavkm.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.
It seems OK to me. We'll do an API review in 5.0 and we can revisit this at that point.