M
Munsifali Rashid
If you want to stop this happening, what you could do is a response.redirect
back to the same page, after your server side event has finished running.
This would reload the page afresh, and when the user hits refresh, it
wouldn't prompt them to re-post the form data.
E.g.
Protected Sub Button1_Click Handles Button1.Click
'Your custom code here
Dim foo As String = "foo"
'Redirect back to this page when done
Response.Redirect(Request.Path)
End Sub
Although it would solve the problem, it would be an additional server round
trip, though I'm not sure it can be avoided...
You could try using Server.Transfer(Request.Path, False), but I don't think
this would work as the page redirect would happen in the background, and
when the user refreshes, it would still prompt them to re-post the form
data.
Hope this helps,
Mun
back to the same page, after your server side event has finished running.
This would reload the page afresh, and when the user hits refresh, it
wouldn't prompt them to re-post the form data.
E.g.
Protected Sub Button1_Click Handles Button1.Click
'Your custom code here
Dim foo As String = "foo"
'Redirect back to this page when done
Response.Redirect(Request.Path)
End Sub
Although it would solve the problem, it would be an additional server round
trip, though I'm not sure it can be avoided...
You could try using Server.Transfer(Request.Path, False), but I don't think
this would work as the page redirect would happen in the background, and
when the user refreshes, it would still prompt them to re-post the form
data.
Hope this helps,
Mun