Tech Off Post

Single Post Permalink

View Thread: using Response.Flush() to send specific data to client
  • User profile image
    Sven Groot

    @lesmemphis: If you want to send non-HTML data, surely it's better to use a generic handler (.ashx) rather than a full web form (.aspx)? It would literally just be the following:

    <%@ WebHandler Language="C#" %>
    using System.Web;
    
    public class YourHandler : IHttpHandler 
    {
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/xml";
            context.Response.Write("<CallbackResponse>Accepted</CallbackResponse>");
        }
    
        public bool IsReusable 
        {
            get { return false; }
        }
    }