Last post Apr 07, 2008 07:41 AM by Hua-Jun Li - MSFT
Apr 02, 2008 09: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 11:05 AM|Rajganesh|LINK
<asp:Button ID="btnSubmit" runat="server" OnClientClick="Disable(this)" Text="Submit" OnClick="btnSubmit_Click" />
Obj.disabled = true;
Apr 02, 2008 11:13 AM|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 11:26 AM|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 07: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,