Solved

page refresh after exporting to excel

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Gridview selected row 9 47
Reading the Web.Config using IIS 7.5? 4 36
VB.net capture  result of a SQL query in variables 3 11
MailAddress in vb 4 15
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

777 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