Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent a PostBack from showing up in the History

I have a page where I submit some data, and return to the original form with a "Save Successful" message. However, the user would like the ability to return to the previous page they were at (which contains search results) by clicking the browser's "Back" button. However, due to the postback, when they click the "Back" button they do not go to the previous page ,they simply go to the same page (but at its previous state). I read that enabling SmartNavigation will take care of this issue (postbacks appearing in the history) however, it has been deprecated. What's the "new" best practice?

*Edit - I added a ScriptManager control, and wrapped the buttons in an UpdatePanel, however now I'm receiving the following error:

Type 'System.Web.UI.UpdatePanel' does not have a public property named 'Button'

Am I missing a reference?

*Disregard the above edit, I simply forgot to add the < ContentTemplate > section to the UpdatePanel :P

like image 396
YourMomzThaBomb Avatar asked Sep 19 '08 15:09

YourMomzThaBomb


People also ask

What is the meaning of postback?

A postback is the exchange of information between servers to report a user's action on a website, network, or app.

What happens during postback?

PostBack is the name given to the process of submitting an ASP.NET page to the server for processing. PostBack is done if certain credentials of the page are to be checked against some sources (such as verification of username and password using database).

What is browser postback?

In web development, a postback is an HTTP POST to the same page that the form is on. In other words, the contents of the form are POSTed back to the same URL as the form. Postbacks are commonly seen in edit forms, where the user introduces information in a form and hits "save" or "submit", causing a postback.

What is postback request?

A postback request is made when user interaction requires a page update, such as when a user clicks on a Save button and triggers a save action.


1 Answers

If you put your "Save" button in an UpdatePanel, the postback will not show in the users history.

like image 146
Espo Avatar answered Sep 28 '22 11:09

Espo