コード例 #1
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     if (!this.Visible)
     {
         captcha = captchProvider.GetCaptcha();
         Control innerCaptchaControl = captcha.GetControl();
         innerCaptchaControl.Visible = false;
         this.Controls.Clear();
     }
 }
コード例 #2
0
ファイル: CaptchaControl.cs プロジェクト: wqshabib/mojoportal
        protected override void OnInit(EventArgs e)
        {
            if (this.Site != null && this.Site.DesignMode)
            {
            }
            else
            {
                base.OnInit(e);
                // an exception always happens here in design mode
                // this try is just to fix the display in design view in VS

                try
                {
                    captchProvider = CaptchaManager.Providers[providerName];
                    captcha        = captchProvider.GetCaptcha();
                    this.Controls.Add(captcha.GetControl());
                }
                catch { }
            }
        }
コード例 #3
0
ファイル: CaptchaControl.cs プロジェクト: saiesh86/TravelBlog
        protected override void OnInit(EventArgs e)
        {
            if (this.Site != null && this.Site.DesignMode)
            {

            }
            else
            {
                base.OnInit(e);
                // an exception always happens here in design mode
                // this try is just to fix the display in design view in VS

                    try
                    {
                        captchProvider = CaptchaManager.Providers[providerName];
                        captcha = captchProvider.GetCaptcha();
                        this.Controls.Add(captcha.GetControl());
                    }
                    catch { }

            }
        }