aspHiddenField: Ideally HiddenField is used to create a hidden field in the form. When it is rendered on the page, it is implemented through <input type=hidden> HTML tag.
Example on HiddenField:
<asp:HiddenField ID="HiddenField1" runat="Server" Value="This is the Value of Hidden field" />
<asp:Button ID="Button1" runat="Server" OnClick="ChangeLabelText" Text="Change Label Text to Hiidden Field Value" />
// CODE BEHIND
// Fires when Button is clicked
protected void ChangeLabelText(object sender, EventArgs e)
{
Label1.Text = hiddeFieldValue.Value;
}
Example on HiddenField:
<asp:HiddenField ID="HiddenField1" runat="Server" Value="This is the Value of Hidden field" />
<asp:Button ID="Button1" runat="Server" OnClick="ChangeLabelText" Text="Change Label Text to Hiidden Field Value" />
// CODE BEHIND
// Fires when Button is clicked
protected void ChangeLabelText(object sender, EventArgs e)
{
Label1.Text = hiddeFieldValue.Value;
}
nice
ReplyDeletekeep on watching this blog, u will get more information
ReplyDelete