private void InitializeComponent()
{
if(this.btnSubmit != null)
{
this.btnSubmit.Click += new System.EventHandler(this.btnSubmit_Click);
}
if(this.btnCompliantSubmit != null)
{
this.btnCompliantSubmit.Click += new EventHandler(this.btnSubmit_Click);
}
//Captcha should not be given to admin.
if (!SecurityHelper.IsAdmin)
{
int btnIndex = 0;
btnIndex = Controls.IndexOf(this.btnSubmit);
if (btnIndex < 0)
btnIndex = Controls.IndexOf(this.btnCompliantSubmit);
AddCaptchaIfNecessary(ref captcha, ref invisibleCaptchaValidator, btnIndex);
}
else
{
RemoveCaptcha();
}
}