Solved

page refresh after exporting to excel

Posted on 2008-10-20
2
1,555 Views
Last Modified: 2013-11-07
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
0
Comment
Question by:praetorean
2 Comments
 
LVL 6

Expert Comment

by:M3mph15
ID: 22765132
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")
0
 

Accepted Solution

by:
praetorean earned 0 total points
ID: 22773111
redirecting does not seem to work...
the page still will not re-post...

and if i put the code on top, excel export would not work either...

would you know any other ways?

thanks anyways...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now