Link to home
Start Free TrialLog in
Avatar of praetorean
praetoreanFlag for Singapore

asked on

page refresh after exporting to excel

Hi all,

how to you repost a page after exporting the content of a datagrid into an excel file?
the following is the scenario that i am working on:

1- datagrid's populated based on a query's resultset.
2- datagrid is manipulated, i.e. data may be updated, rows selected via check boxes.
3- back-end data is updated
4- selected rows are exported to excel

my problem here is such that, after i am able to export to excel using the code below:
        attach = "attachment;filename=[excel filename]"
        Response.ClearContent()
        Response.ContentType = "application/vnd.ms-excel"
        Response.AddHeader("content-disposition", attach)
            Response.Write(stringWrite.ToString)
            Response.End()
            
i would like to be able to repost the page to be able to do a refresh.
how do you code to initiate a page refresh at runtime?

thanks
Avatar of M3mph15
M3mph15
Flag of Australia image

Why not Redirect to the same page.
So it becomes
attach = "attachment;filename=[excel filename]"
        Response.ClearContent()
        Response.ContentType = "application/vnd.ms-excel"
        Response.AddHeader("content-disposition", attach)
            Response.Write(stringWrite.ToString)
            Response.End()
        Response.Redirect("Page.aspx")
ASKER CERTIFIED SOLUTION
Avatar of praetorean
praetorean
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial