retain asp.net page state

Joined
May 24, 2011
Messages
1
Reaction score
0
I have a asp.net (c#) web app where I have a button, dropdown list and a textbox. I make a selection from the dropdown
and enter something in the textbox. I press the button and depending on the dropdown item selected and the text entered in the textbox, a csv displays in the browser. Note this is not a new browser window, I do not want a new browser window
I use
Response.AddHeader("Content-Disposition", "inline; filename=report.csv");
Response.ContentType = "application/octet-stream";
Response.BinaryWrite(bytes);
Response.End();

the csv appears. Now I want to be able to go back to the previous page and have the previous page state come back. how do I return to the previous state? I've read about viewstate, but i'm not sure how to use this, or even if this is the correct approach. can some give an example or point me in the right direction?

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top