mainrotor
asked on
I need help using Response.ContentType = "application/vnd.ms-excel" in ASP.net
Hi Experts,
I have an ASP.Net application with VB.Net codebehind. I want to use Response.ContentType = "application/vnd.ms-excel" to display the output in Excel, but it's not working. What am i doing wrong (see vb.net codebehind, below)?
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.ContentType = "application/vnd.ms-excel"
Dim strString As String
strString = "<table><tr><td>1</td><td> 2</td><td> 3</td><td> 4</td></tr ></table>"
Response.Write(strString)
End Sub
End Class
Thanks in advance,
mrotor
I have an ASP.Net application with VB.Net codebehind. I want to use Response.ContentType = "application/vnd.ms-excel"
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.ContentType = "application/vnd.ms-excel"
Dim strString As String
strString = "<table><tr><td>1</td><td>
Response.Write(strString)
End Sub
End Class
Thanks in advance,
mrotor
ASKER
No that didn't work.
i duuno what is this vnd.ms-excel is about.
if you are trying to generate some special kind of content, i think the part about table...tr..td won't work.
that's for html. unless your vnd.ms-excel can read/render normal html file.
if you are trying to generate some special kind of content, i think the part about table...tr..td won't work.
that's for html. unless your vnd.ms-excel can read/render normal html file.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Response.AddHeader("conten