// -- Set download file name ViewContext.HttpContext.Response.AppendHeader("content-disposition", string.Format("inline;FileName=\"{0}\"", "Health Catalyst Product List.csv")); }
My error message is: HttpResponse' does not contain a definition for 'AppendHeader' and no accessible extension method 'AppendHeader' accepting a first argument of type 'HttpResponse'
I am pretty sure I just don't have the proper command or syntax for the AppendHeader method
Umbraco 9 equivalent of Umbraco 8 Response.AppendHeader
This works in Umbraco 8
@inherits Umbraco.Web.Mvc.UmbracoViewPage @using ContentModels = Umbraco.Web.PublishedModels; @using Umbraco.Web.Models; @{ Response.ContentType = "application/CSV";
// -- Set download file name Response.AppendHeader("content-disposition", string.Format("inline;FileName=\"{0}\"", "Health Catalyst Product List.csv")); }
Umbraco 9 ??
@using Umbraco.Cms.Web.Common.PublishedModels; @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage @using Umbraco.Cms.Core.Models; @using Umbraco.Extensions @using TemplateToPdf.Builders; @{ ViewContext.HttpContext.Response.ContentType = "application/CSV";
// -- Set download file name ViewContext.HttpContext.Response.AppendHeader("content-disposition", string.Format("inline;FileName=\"{0}\"", "Health Catalyst Product List.csv")); }
My error message is: HttpResponse' does not contain a definition for 'AppendHeader' and no accessible extension method 'AppendHeader' accepting a first argument of type 'HttpResponse'
I am pretty sure I just don't have the proper command or syntax for the AppendHeader method
Any help is appreciated.
I finally stumbled on the the proper Umbraco 9 function as shown below:
// -- Set download file name ViewContext.HttpContext.Response.Headers.Add("content-disposition", string.Format("inline;FileName=\"{0}\"", "Health Catalyst Product List.csv"));
is working on a reply...