I had asp.net form app I have a bug when the user click F5 or refresh it will enter the data from last data entry .is their is away to Prevent sending data if user click click F5 or refresh?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Carriage Return (ASCII chr 13) is missing from tex
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
A common solution to this is called Post Redirect Get (PRG), where the browser is immediately redirected to a HTTP Get page after any post. See Post Redirect Get in asp.net for a web forms implementation.
There are multiple ways to prevent this from happening. The simplest is to
Response.Redirect
to a another page, which can be refreshed without consequence.It's easy to reset a page to it's initial state in ASP.NET by redirecting to itself. Here are 3 ways you can do it:
In which the path to the request is presented in the following form: /MyApp/MyFile.aspx
In which not only is the path exposed, but also any querystring parameters like: /MyApp/MyFile.aspx?foo=bar
In which not only is the path and querystring parameters exposed, but made available as an absolute reference in the form: MyServer/MyApp/MyFile.aspx?foo=bar