HiddenField
HiddenField Example
Please enter a value and click the submit button.
@inherits ControlComponent
<p>Please enter a value and click the submit button.</p>
<asp.TextBox ID="ValueTextBox" />
<br />
<br />
<asp.Button OnClientClick="$('#ValueHiddenField').val($('#ValueTextBox').val());"
OnClick="this.SubmitBtn_Click">Submit</asp.Button>
<br />
<asp.Label @ref="this.message" />
<asp.HiddenField @ref="this.valueHiddenField" ID="ValueHiddenField"
Value="" />
@code {
private Label message;
private HiddenField valueHiddenField;
protected void SubmitBtn_Click(object sender, EventArgs e)
{
// Display the value of the HiddenField control.
message.Text = "The value of the HiddenField control is " + valueHiddenField.Value + ".";
}
}
HiddenField Metadata
Name | Type | Kind |
---|---|---|
Attributes | IReadOnlyDictionary | Parameter |
ClientIDMode | ClientIDMode | Parameter |
ID | String | Parameter |
Value | String | Parameter |
Visible | Boolean | Parameter |
OnDataBinding | EventHandler | Event |
OnDisposed | EventHandler | Event |
OnInit | EventHandler | Event |
OnLoad | EventHandler | Event |
OnPreRender | EventHandler | Event |
OnUnload | EventHandler | Event |
OnValueChanged | EventHandler | Event |