views:

107

answers:

1

I am unable to generate an excel in an Atlas Update Panel. (Since a response cannot be ended/written [XML] in the update panel) I don't want to use asp:updatepanel .. Is there any other way?

Any correct answer will be highly appreciated...

Thanks in advance

A: 

I guess that you don't need to, since you can send a common request to generate the excel file, without leaving the current page, causing the same effect as doing it with AJAX.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
    Response.clear()
    Response.ContentType = "application/ms-excel;"
    Response.AppendHeader("content-disposition", "attachment; filename=""excel-file.xml""")

    'write all the file to the response object


    Response.Flush()
    Response.End()

End Sub
Eduardo Molteni