By default, do functions automatically reload the page after execution. This avoids the double submit problem, which is annoying if CSRF tokens are in play.
It's also possible to prevent this behaviour by adding the NoReloadDo Attribute.
However, it's sometimes useful to use the default post-redirect-get pattern, but override it within the do function. The most obvious example of this is when server side form validation fails: we would want to return the do function, but without causing the page to reload, so the validation errors are displayed correctly.
By default,
do
functions automatically reload the page after execution. This avoids the double submit problem, which is annoying if CSRF tokens are in play.It's also possible to prevent this behaviour by adding the
NoReloadDo
Attribute.However, it's sometimes useful to use the default post-redirect-get pattern, but override it within the do function. The most obvious example of this is when server side form validation fails: we would want to return the do function, but without causing the page to reload, so the validation errors are displayed correctly.