Ошибка примерно такая:
альтернативный текст http://i020.radikal.ru/1005/76/e94bd2f2c61f.jpg
Не удается загрузить Items.aspx с 192.168.0.172
И текст не может открыть этот веб-сайт. Это не может быть найдено. Попробуй позже
код:
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Charset = System.Text.Encoding.Unicode.EncodingName;
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.Unicode;
HttpContext.Current.Response.BinaryWrite(System.Text.Encoding.Unicode.GetPreamble());
HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";
HttpContext.Current.Response.AddHeader(
"content-disposition", string.Format(
"attachment; filename={0}",fileName));
....
table.RenderControl(htw);
HttpContext.Current.Response.Write(sw.ToString());
HttpContext.Current.Response.End();
Проблема с этим файлом есть только для Internet Explorer (работает на Opera / Firefox ...)
И так работает для HTML без
HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";
эта строка
Как избежать этой ошибки в IE?