private void SubmitHandler(object sender, EventArgs e) { bool showThankyou = true; if(UseCustomFormHandler) { var ea = new SendFormEventArgs(_formContainer.Controls); OnSendForm(ea); showThankyou = ea.FormWasSentCorrectly; } else { SendFormAsEmail(); } if(ThanksUrl != null) { HttpContext.Current.Response.Redirect(ThanksUrl.ToString()); } else if(showThankyou) { ShowThankYouMessage(); } }
protected virtual void OnSendForm(SendFormEventArgs e) { SendForm(this, e); }