I am new to .NET and I want to develop the application which send multiple HTTP responses to the single HTTP Request.
Is there any way that I can store HTTP Handler on server which can be used when it is needed.
I am new to .NET and I want to develop the application which send multiple HTTP responses to the single HTTP Request.
Is there any way that I can store HTTP Handler on server which can be used when it is needed.
You would break the HTTP standard by sending multiple responses to a request.
However, you can use Transfer-Encoding "chunked" which sends a response in multiple parts. In regular ASP.Net you would use Response.Flush() to achieve this.
I guess that you have to execute the ActionResult and send it manually with the response object to be able to send multiple parts in the same response.
Static members persist across multiple requests, so you could do this:
public static class HttpHandlerStorage
{
// this should still be here, unless the HttpApplication reloads.
public static IHttpHandler StoredHandler { get; set; }
}
However, your HttpContext will get destroyed at the end of the request.