The ViewRestored Event occurs when a view has been restored because browser user has used the back/forward button and submitted a form that doesn't match the view on the web server. The CE Web Form Renderer provides the capability of detecting when the view in the browser is out of sync with the view on the web server. This can happen when the browser user navigates the history of web pages using the back or forward buttons and accidentally submits a form that doesn't match the form in the current state on the web server. In this case, the CE Web Form Renderer restores the view in the current state, presenting the user with the same view as before. Since it is not possible to disable back or forwards buttons in the browsers, this ensures that the view in the browser is the same as the current state on the web server, which matches with the state of the application on the host.
If intercepted, the programmer of the hosting page can access the Session and Status objects. The normal processing of the CE Web Form Renderer can be altered via properties on the CEWebFormRendererEventArgs object.
Example hosting page ViewRestored event handler. (C#)
private void OnViewRestored(object sender, CEWebForm.CEWebFormRendererEventArgs e) { // Register script for setting alerting the user. string script = "<script language=\"javascript\">" + "alert (\"The view has been restored. The transaction has not been sent to the host application.\");" + "</script>"; Page.RegisterStartupScript("ViewRestoredAlert", script);