Skip to content

OneClickSubmit

OneClickSubmit is a Button subclass that injects a client-side JavaScript guard preventing the same rendered button from triggering more than one form submission per page instance (BR-V2-007).

Purpose

  • Prevent accidental duplicate submissions (e.g., from double-clicking or slow postbacks) by canceling the second and subsequent click events client-side.
  • Apply a default CSS class (NormalButton) when the host page has not set one.

Context

  • Namespace: SAIF.Presentation.Web.Controls.V2
  • Assembly/package: Compiled into SAIF.BOF.Presentation.Web.Infragistics103*

Public members

Member Signature Purpose
DEFAULT_CSS_CLASS Public Const DEFAULT_CSS_CLASS As String = "NormalButton" Default CSS class applied to the rendered button when the host page has not set CssClass.

Inherited public members

OneClickSubmit inherits from Button (System.Web.UI.WebControls), a framework base class rather than a documented SAIF dependency library.

Member Signature Purpose
CausesValidation Public Property CausesValidation As Boolean Determines whether clicking the button triggers ASP.NET validator checks before postback.
CommandArgument Public Property CommandArgument As String Caller-supplied payload passed through command events so pages can distinguish which action fired.
CommandName Public Property CommandName As String Semantic command name raised during command handling for higher-level page logic.
OnClientClick Public Property OnClientClick As String Client-side JavaScript executed before postback; this control sets it to the one-click guard.
PostBackUrl Public Property PostBackUrl As String Cross-page postback target when the button submits to another page.
Text Public Property Text As String Caption rendered on the button face.
UseSubmitBehavior Public Property UseSubmitBehavior As Boolean Controls whether the button renders as a native submit element or uses ASP.NET postback script.
ValidationGroup Public Property ValidationGroup As String Validator group name evaluated when the button is clicked.
Click Public Event Click As EventHandler Standard button click event raised after the postback reaches the server.

Standard Button/Control members (ID, ClientID, Controls, Visible, DataBind, FindControl, etc.) are not re-documented here as they are unmodified framework behavior**.

Behavioral notes

  • OnLoad calls InitializeControls() (sets OnClientClick = "return OneClickOnly()") and BuildClientOneClickJavascript() (registers the shared WasClicked flag variable and OneClickOnly() function scripts once per page).
  • Render applies DEFAULT_CSS_CLASS only if CssClass is blank, then delegates to the base Button.Render.
  • See BR-V2-007 for the enforced duplicate-submission rule.

Constraints and usage notes

  • The duplicate-submit guard relies entirely on client-side JavaScript (WasClicked variable); if JavaScript is disabled, the control provides no protection**.

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • SAIF.Presentation.Web.Controls.V2\OneClickSubmitControl.vb