2
Answers

Refresh Label from ASP.NET HTML

Samuel Toh

Samuel Toh

3y
802
1

protected void btnSubmit_Click(object sender, EventArgs e)

{

Application["Summary"] = lblTotalSummary.Text;

}

protected void Button1_Click(object sender, EventArgs e)

{

if (Application["Summary"] != null)
        {
            string Name = Application["Summary"].ToString();
            lbliPhone12.Text = "iPhone 12 Series:<br>" + Name;
        }
        else if(Application["Summary"] == null)
        {
            return;
        }

}

 

So above is what I have used to transfer a label value output to another. However, everytime when I run the page again and click on "Button1". It shows the same output as the previous one. Is there any way where I can refresh the label output so that it has no value inside?

Answers (2)