protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
string prevent = "if (typeof(Page_ClientValidate) == 'function') { " +
"if (Page_ClientValidate() == false) { return false; }} " +
"this.value = 'Submitting...';" +
"this.disabled = true;" + this.Page.GetPostBackEventReference(ButtonSubmit) + ";";
ButtonSubmit.Attributes.Add("onclick", prevent);
}
}