public void Save(object s, EventArgs e)
{
HtmlMeta meta = new HtmlMeta() { Name = "DownloadOptions", Content = "noopen" };
MetaPlaceHolder.Controls.Add(meta);
string name = "Editor.html";
//Response.AppendHeader("X-Download-Options", "noopen");
Response.AppendHeader("content-disposition", "attachment; filename=" + name);
Response.WriteFile(Server.MapPath("~/SentinelOperationsUI/Editor.html"), true);
Response.End();
}
The meta tag, <meta name="DownloadOptions" content="noopen" />, works great in ie7 if i add it manually to the header. But if i try to add it dynamically like this, i get no effect.
What do i need to do to add this meta tag for this download buttons event click? I only want it added to this button. Do i need to remove it in all other download buttons click events?
Hope you get the idea, otherwise ill elaborate. Thanks!
You set a header that go inside the header of a page, then you append a header that try to load a file, and then you send one html file.
The append header with the attachment file is overwrite and ignore the html header that you try to set before, but also the html file that you send with the writeFile is direct send to the browser, and the response.End stop all other writing, including the HtmlMeta that you have add before.
Even if you remove the .End() the header is going to be written after all data that you send and also have no meaning.