Method GenerateHiddenForCheckbox
| Improve this Doc View SourceGenerateHiddenForCheckbox(ViewContext, String)
Generate an additional <input type="hidden".../> for checkboxes. This addresses scenarios where unchecked checkboxes are not sent in the request. Sending a hidden input makes it possible to know that the checkbox was present on the page when the request was submitted.
Declaration
TagBuilder GenerateHiddenForCheckbox(ViewContext viewContext, string fullHtmlFieldName)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Mvc.Rendering.ViewContext | viewContext | The view context. |
System.String | fullHtmlFieldName | The full HTML field name. |
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Mvc.Rendering.TagBuilder | The tag builder. |