Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends,
I have created an application in mvc.In that application there is a form for add details to the database.So in the form there is a captcha image .i have written the code for update image using ajax while refreshing the captcha image.But the actual problem is when i click on the refresh button some characters appears in the place of image.How can i solve this problem?
my code is given below.
<img src="/{Controller}/ShowCaptchaImage" alt="Captcha"  width="238" height="53"/>

In my controller
public CaptchaImageResult ShowCaptchaImage()
       {
           //return new CaptchaImageResult();
           Session["CaptchaImageText"] = GetCaptchaString(6);
           CaptchaImageResult ci = new CaptchaImageResult(
       this.Session["CaptchaImageText"].ToString(),
       200, 50, "Century Schoolbook");
           this.Response.Clear();
           this.Response.ContentType = "image/jpeg";
           ci.Image.Save(this.Response.OutputStream, ImageFormat.Jpeg);
           ci.Dispose();
           return ci;



Thank you developer Guys,
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900