I have an asp.net ASHX handler which is accepting xml data as input and generating a pdf document and returns it to the response as follows:
public override void NowProcessTheRequest(XmlWriter xw)
{
var bytes = get pdf bytes from service based on input xml xw
var fileName="test";
context.Response.ContentType = "application/pdf";
context.Response.Headers.Add("Content-Disposition",
string.Format("inline; filename=report_{0}_{1}.pdf", fileName, DateTime.Now.ToString("MM_dd_yyyy")));
context.Response.Write(bytes);
context.Response.Flush();
}
now i want to open the generated pdf in a new window from javascript.
i am not able to use "window.open" as i am not sure how to pass xml in the body. so what option i have to call this ashx handler from javascript and post a xml data and open the response pdf in a new window.?