Post Redirect Get at asp.net

I am interested in implementing PRG on my website for some of the forms that I created. Currently, they are returning to themselves, and, obviously, updating these pages, the data is duplicated. Can someone point me towards a good tutorial on how I can encode this on my website? I understand the logic, but I donโ€™t know where to start. Thanks

+3
source share
1 answer

After postback to the form, you just need to redirect after postback.

DoPostbackProcessing();
Response.Redirect("FormConfirmationPage.aspx");

, , (GET) , . , - , , .

EDIT: , , , , GET:

// Instead of performing search now we will redirect to ourselves with the criteria.
var url = "SearchPage.aspx?criteria=" + txtSearch.Text;
Response.Redirect(url);

, , THEN , , - .

+6

All Articles