title: jquery update captcha
body: <p>I trying to update captcha with js and ASP.NET MVC3 razor. I found this solution:
  View:</p>
  
  <pre><code>&lt;div id ="CaptchaDiv"&gt; &lt;img alt="Captcha" id="Captchaimg" src="@Url.Action("GetCaptcha")" style="" /&gt;&lt;/div&gt;  &lt;input type="button"  value="Refresh" onclick=" return GetCaptcha()" /&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public ActionResult GetCaptcha ()
          {
              FileContentResult img = null;
              int res = 0;
              MemoryStream mem = Metods.CaptchaImage( out res);
              Session["Captcha"] = res;
            img = this.File(mem.GetBuffer(), "image/Jpeg");
              return img;
          }
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>function GetCaptcha()
   {
       $('Captchaimg').attr('src', '/Account/GetCaptcha?' + new Date().getTime());
   }
  </code></pre>
  
  <p>But: it doesn't work. JS runs  successfuly. But controller action doesn't run. What is wrong? Any ideas?</p>