Solved

page refresh after exporting to excel

Posted on 2008-10-20
2
1,534 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

22 Experts available now in Live!

Get 1:1 Help Now