protected void vldCaptcha_ServerValidate(object source,ServerValidateEventArgs args) { args.IsValid = m_captcha.Verify(hidCaptcha.Value, tbCaptcha.Text); } protected void btnSubmit_Click(object sender, EventArgs e) { if(Page.IsValid) Response.Redirect(ABCFunctions.AspxFilenameWithoutExt + "/Thank-you.aspx"); else GenerateCaptcha(); }
Server.MapPath(captchaTempDir)); if (!IsPostBack) GenerateCaptcha(); } private void GenerateCaptcha() { hidCaptcha.Value = m_captcha.CreateImage(); imgCaptcha.ImageUrl = m_captcha.LastImageUrl; tbCaptcha.Text = ""; }
YartCaptcha m_captcha; protected void Page_Load(object sender, EventArgs e) { string captchaTempDir = AppPath + "admin/temp/"; m_captcha = new YartCaptcha(125, 50, captchaTempDir,