- 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
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