Save As Authentication Issue From ASP.NET

M

Matt Schwartz

I have a ASP.NET web application written using VB.NET. I have a data
grid, that is sent to the browser as an excel document using the
following code

Private Sub CreateXLS(ByVal xdatagrid As DataGrid)
Response.Clear()
Response.AddHeader("content-disposition",
"filename=New_Report.xls")
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentType = "application/vnd.ms-excel"
Dim stringWrite As System.IO.StringWriter = New
System.IO.StringWriter
Dim htmlWrite As System.Web.UI.HtmlTextWriter = New
HtmlTextWriter(stringWrite)
xdatagrid.RenderControl(htmlWrite)
Response.Write(stringWrite.ToString)
Response.End()
End Sub


When this function is run, the user is prompted and asked whether they
want to save or open the file. Saving works properly - saving the file
directly to their local hard drive, and opening works properly - opening
the spreadsheet in the browser.

However, when a user first opens the file in the browser, then tries to
do a "save as" to save the file locally, they are prompted with a dialog
box asking for authentication. If they cancel, the dialog box disappears
and they are unable to save. The server that this is hosted on is
Windows 2003 Server Standard edition. Users are using Excel 2003.

How can I get rid of this authentication prompt?

Any help is greatly appreciated!

Sincerely,
Matt Schwartz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top