My buttons click event handler is like this;
$(".imgRefreshContact").click(function () {
$.ajax({
url: "/Presentation/Site/Handlers/RefreshCaptcha.ashx",
type: "POST",
cache: false,
async: true,
success: function () { }
});
$("#imgCaptcha").attr('src', '/Presentation/Site/Handlers/CreateCaptcha.ashx');
});
RefreshCaptcha handler;
public void ProcessRequest(HttpContext context)
{
context.Session["CaptchaMetin"] = ConfirmCode.GenerateRandomCode();
}
CreateCapthca handler;
public void ProcessRequest(HttpContext context)
{
ConfirmCode cc = new ConfirmCode(context.Session["CaptchaMetin"].ToString(), 136, 36);
context.Response.Clear();
context.Response.ContentType = "image/jpeg";
cc.Image.Save(context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
cc.Dispose();
}
When I clicked an img button, it's working perfect in Chrome and Firefox but fails in IE 9 Debugger enters into RefreshCaptcha handler but not enters into CreateCaptcha handler. So, IE makes ajax request once, not second time.
What is the problem with IE and ajax request