Exemplo n.º 1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string EncodedResponse = Request.Form["g-Recaptcha-Response"];
            bool   IsCaptchaValid  = (ReCaptchaClass.Validate(EncodedResponse) == "true" ? true : false);

            if (IsCaptchaValid)
            {
                saveContactInfo();
                sendMail();
                lblStatus.ForeColor = System.Drawing.Color.Green;
                lblStatus.Text      = "Thanks for your interest, Information stored Successfully !";
                emptytxtBox();
            }
            else
            {
                lblStatus.ForeColor = System.Drawing.Color.Red;
                lblStatus.Text      = "Sorry Information is not stored";
                emptytxtBox();
            }
        }
Exemplo n.º 2
0
        protected void BtnSubmitCV_Click(object sender, EventArgs e)
        {
            string EncodedResponse = Request.Form["g-Recaptcha-Response"];
            bool   IsCaptchaValid  = (ReCaptchaClass.Validate(EncodedResponse) == "true" ? true : false);

            if (IsCaptchaValid)
            {
                saveContactInfo();
                sendMail();
                lblStatus.ForeColor  = System.Drawing.Color.Green;
                lblStatus.Text       = "Thanks for your interest, Information stored Successfully !";
                Response.ContentType = "application/octect-stream";
                Response.AppendHeader("Content-disposition", "filename= Santha_kumar_CV.docx");
                Response.TransmitFile(Server.MapPath("~/File/Santha_kumar_CV.docx"));
                Response.End();
                emptytxtBox();
            }
            else
            {
                lblStatus.ForeColor = System.Drawing.Color.Red;
                lblStatus.Text      = "Sorry Information is not stored";
                emptytxtBox();
            }
        }