captcha generate and validate with refresh button using asp.net c# mvc
<p>I am trying to make captcha code. this is my code in model to generate captcha.</p>

<pre><code>private static Random random = new Random();
    public override void ExecuteResult(ControllerContext context)
    {
        Bitmap bmp = new Bitmap(100, 30);
        Graphics g = Graphics.FromImage(bmp);
        g.Clear(Color.DeepPink);
        string randomString = GetCaptchaString(6);
        context.HttpContext.Session["captchastring"] = randomString;
        g.DrawString(randomString, new Font(FontFamily.GenericSansSerif, 17,FontStyle.Italic), new SolidBrush(Color.WhiteSmoke), 2, 2);
        HttpResponseBase response = context.HttpContext.Response;
        response.ContentType = "image/jpeg";
        bmp.Save(response.OutputStream, ImageFormat.Jpeg);
        bmp.Dispose();
    }

    public string GetCaptchaString(int length)
    {
        const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
        return new string(Enumerable.Repeat(chars, length)
          .Select(s =&gt; s[random.Next(s.Length)]).ToArray());
    }
</code></pre>

<p>The captcha view code is as following</p>

<pre><code>  @using (Html.BeginForm("index", "home"))
  {

    &lt;p&gt;&lt;img src="/home/ShowCaptchaImage" id="imgCaptchaShow" /&gt;&lt;/p&gt;`
    &lt;p&gt;Please enter the string as shown above:&lt;/p&gt;`
    &lt;p&gt;@Html.TextBox("CaptchaText")&lt;/p&gt;&lt;a href="#" onclick="javascript:RefreshCaptcha();"&gt;Refresh&lt;/a&gt;`
    &lt;p&gt;&lt;input type="submit" value="Submit" /&gt;&lt;/p&gt;

  }
</code></pre>

<p>I want to generate captcha again on refresh link without refreshing page.</p>