page refresh is firing the event again

前端 未结 5 1050
抹茶落季
抹茶落季 2021-01-01 01:51

IN asp.net when I submit form and refresh it, the data resubmitted again? Is there a way in C# to trap the page refresh event on page load??

5条回答
  •  青春惊慌失措
    2021-01-01 02:17

    for example: if you click on 'button' system will catch the event 'button_click'. if you refresh the page, system will re execute again the same event. to don t have this problem, in your event insert : on your event

    private void button_click(object sender, System.EventArgs e)
    {
        button.Enabled =false;
        button.Enabled =true;
    }
    

    is what you meant?

提交回复
热议问题