Last post Apr 07, 2008 08:41 AM by Hua-Jun Li - MSFT
Apr 02, 2008 10:54 AM|afrika|LINK
How do i prevent a form from being submitted twice ? Or more times, when submitted
(This way i can have full control of what is being submitted)
Apr 02, 2008 12:05 PM|Rajganesh|LINK
<asp:Button ID="btnSubmit" runat="server" OnClientClick="Disable(this)" Text="Submit" OnClick="btnSubmit_Click" />
Obj.disabled = true;
Apr 02, 2008 12:13 PM|afrika|LINK
Because i noticed if you do refresh the page, after submitting. It posts it twice.
Are there anyways in .net of guarding against submitting it twice ?
Apr 02, 2008 12:26 PM|Rajganesh|LINK
There is no default function available in .NET to detect the page refresh. But the below given link has an article which shows one of the way to achieve it. just check it.
Apr 07, 2008 08:41 AM|Hua-Jun Li - MSFT|LINK
Pease try the following method.
<asp:Button ID="Button1" runat="server" Height="38px" Text="Button" Width="143px" OnClick="Button1_Click" BorderStyle="Inset" />
Then you can add the code at Pgae_load to prevent the submit twince or more.
protected void Page_Load(object sender, EventArgs e)
Let me know if I have misunderstood what you mean.
Hope it helps,