I am using the following code for an onclick event on my web app.
' Set the content type to Excel.
Response.ContentType = "application/vnd.ms-excel"
' Remove the charset from the Content-Type header.
Response.Charset = ""
' Turn off the view state.
Me.EnableViewState = False
Dim strw As New System.IO.StringWriter
Dim htmlw As New System.Web.UI.HtmlTextWriter(strw)
' Get the HTML for the control.
dg.RenderControl(htmlw)
' Write the HTML back to the browser.
Response.Write(strw.ToString())
' End the response.
Response.End()
When the user clicks it they prompted to save or open. When they choose open it opens in IE. If the dataset they are working with is large, it grays out the Back Button, so they can't get back to where they were. Anyone know if there is a way to fix this, or a way to allow save only, and not open. I can't seem to find the answer anywhere.
Thanks,
shankel
' Set the content type to Excel.
Response.ContentType = "application/vnd.ms-excel"
' Remove the charset from the Content-Type header.
Response.Charset = ""
' Turn off the view state.
Me.EnableViewState = False
Dim strw As New System.IO.StringWriter
Dim htmlw As New System.Web.UI.HtmlTextWriter(strw)
' Get the HTML for the control.
dg.RenderControl(htmlw)
' Write the HTML back to the browser.
Response.Write(strw.ToString())
' End the response.
Response.End()
When the user clicks it they prompted to save or open. When they choose open it opens in IE. If the dataset they are working with is large, it grays out the Back Button, so they can't get back to where they were. Anyone know if there is a way to fix this, or a way to allow save only, and not open. I can't seem to find the answer anywhere.
Thanks,
shankel