HtmlHelper.Hidden Method (String, Object, IDictionary<String, Object>)
Returns an HTML hidden control that has the specified name, value, and custom attributes defined by an attribute dictionary.
Namespace: System.Web.WebPages.Html
Assembly: System.Web.WebPages (in System.Web.WebPages.dll)
Syntax
'Declaration
Public Function Hidden ( _
name As String, _
value As Object, _
htmlAttributes As IDictionary(Of String, Object) _
) As IHtmlString
'Usage
Dim instance As HtmlHelper
Dim name As String
Dim value As Object
Dim htmlAttributes As IDictionary(Of String, Object)
Dim returnValue As IHtmlString
returnValue = instance.Hidden(name, value, _
htmlAttributes)
public IHtmlString Hidden(
string name,
Object value,
IDictionary<string, Object> htmlAttributes
)
public:
IHtmlString^ Hidden(
String^ name,
Object^ value,
IDictionary<String^, Object^>^ htmlAttributes
)
member Hidden :
name:string *
value:Object *
htmlAttributes:IDictionary<string, Object> -> IHtmlString
public function Hidden(
name : String,
value : Object,
htmlAttributes : IDictionary<String, Object>
) : IHtmlString
Parameters
- name
Type: System.String
The value to assign to the name attribute of the HTML control element.
- value
Type: System.Object
The value to assign to the value attribute of the element.
- htmlAttributes
Type: System.Collections.Generic.IDictionary<String, Object>
The names and values of custom attributes for the element.
Return Value
Type: System.Web.IHtmlString
The HTML markup that represents the hidden control.
Exceptions
Exception | Condition |
---|---|
ArgumentException | name is null reference (Nothing in Visual Basic) or empty. |
Remarks
The returned markup consists of an HTML input element in the following form:
<input type="hidden" name="name" value="value" ...htmlAttributes... />
Before the value object is rendered to the input element, the value object is converted into an array of bytes and encoded using base-64 encoding.