page refresh is firing the event again

前端 未结 5 1012
抹茶落季
抹茶落季 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:26

    You could, if it has any point in your mind, make the page refresh itself automatically after submitting the form, reloading the page removing all text from textboxes etc. You do this by adding the following code -> Page.Redirect(Request.RawUrl); in the bottom of your submit method.

提交回复
热议问题