Arun Kurmi

Arun Kurmi

  • NA
  • 104
  • 103.6k

urgent-Hidden field example

Jul 23 2013 10:28 AM
hi friends,
Please give examples on hidden field-
1) to store and retrieve text.

2)to increase number on label on every button click by using hidden field.

i have seen various example but all gives incorrect format exception one of the example are-

protected void Page_Load(object sender, EventArgs e)
{
   if (HiddenField1.Value != null)
   {
    int val= Convert.ToInt32(HiddenField1.Value) + 1;
    HiddenField1.Value = val.ToString();
    Label1.Text = val.ToString();
   }
}
protected void Button1_Click(object sender, EventArgs e)
{
  //this is No Action Button Click
}

Answers (3)