protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["randomNo"] != null) { string text = Request.QueryString["randomNo"].ToString(); int captchaWidth = 310; int captchaHeight = 50; Captcha.caseSensitive = false; Captcha ci = new Captcha(); ci.Captchaimage(captchaWidth, captchaHeight, text); Response.Clear(); Response.ContentType = "image/png"; ci.Image.Save(Response.OutputStream, ImageFormat.Jpeg); ci.Dispose(); } else { Response.Redirect("~/Error.aspx"); } }