i tried this but dose not work
@{
HttpContext.Current.Items["key"] = Reservation.ConfirmationFilename;
}
and this is context
public class DownloadFile : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
//here file name is null
string fileName = (string)(HttpContext.Current.Items["key"]);
context.Response.Clear();
context.Response.ContentType = "application/pdf";
context.Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
context.Response.TransmitFile(fileName);
context.Response.End();
}
public bool IsReusable
{
get
{
return false;
}
}
}
the problem is filename
is null after i assign the value to it .
any advice to send data from view to httpcontext