I have a requirement to write an http handler that will instantiate telerik captcha object and will return byte array of captcha image.
This http handler will be the source for IMG on another page.
Default.aspx:
<img src="Handler1.ashx" alt="Alternate Text" />
Handler1.ashx:
public class Handler1 : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
Telerik.Web.UI.CaptchaImage captchaImage = new Telerik.Web.UI.CaptchaImage();
// How can I return captchaImage's byte array (it is not a binary image)
context.Response.ContentType = "image/JPEG"; // ??
}
public bool IsReusable
{
get { return false; }
}
}
Just render the image within the captcha and convert that to a byte array.