Telegram_2022-09-07T21

<< Click to Display Table of Contents >>

Navigation:  Telegram > 2022 > 09 > 07 >

Telegram_2022-09-07T21

Telegram link

 

2022-09-07T21:24:33

 

Refresh won't trigger in this case, because it is not actually a refresh (although it is triggered by a F5) but a RE-POST request.

 

A refresh (in OnRefreshForm context) can only be a GET request

 


 

Telegram link

 

2022-09-07T21:25:54

 

Another user, in another group, asked me how to prevent this message from occurring. Maybe it is also relevant to you, so I'm reposting my answer here:

 


 

Telegram link

 

2022-09-07T21:25:55

 

The only way to prevent this is using the pattern Post-Redirect-Get, which IW supports out of the box (you just need to turn it on in ServerController.PostRedirectGet option). Setting it to prgEnabled will turn it on for all POST requests.

 

When using the Post-redirect-get pattern, IntraWeb will create a redirect request in response to any POST request that it receives, but the redirect will generate a new GET request. GET requests don't generate that \resubmit message\ because there are no parameters being submitted.

 

Have in mind that PRG causes an additional request for all synchronous POST requests that it receives, but in general it's worth it and the benefits outweigh the drawbacks

 


 

Telegram link

 

2022-09-07T21:26:05

 

so, whenever the user refreshes a page, it will force the previous request to be sent again, which will always be a GET request, not a POST request

 


 

Telegram link

 

2022-09-07T21:26:14

 

type: link https://en.wikipedia.org/wiki/Post/Redirect/Get

 


 

Telegram link

 

2022-09-07T21:26:36

 

Whenever you have a POST request (not async), refreshing the page afterwards will always generate that message in any browser, because it will re-submit the same parameters to the server again.

 

IW also has some built-in functionality to minimize the risk of processing the same parameters twice (e.g. processing a purchase or a cc/bank transaction), via property ServerController.SecurityOptions.PreventDoubleSubmission.

 

When this is set, IW will discard a second POST request containing exactly the same parameters in a single session