retain asp.net page state

Discussion in '.NET' started by mark.csharp, May 24, 2011.

  1. mark.csharp

    mark.csharp

    Joined:
    May 24, 2011
    Messages:
    1
    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
     
    mark.csharp, May 24, 2011
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pål Andreassen

    Retain treeview state during navigation

    Pål Andreassen, Mar 10, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    4,768
    Ducati748
    Mar 27, 2008
  2. jnickfl1
    Replies:
    0
    Views:
    637
    jnickfl1
    Sep 18, 2006
  3. archana
    Replies:
    0
    Views:
    376
    archana
    Mar 13, 2007
  4. Don

    Can't retain state for Control inherted from ListBox

    Don, Apr 21, 2005, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    158
    recoil@community.nospam
    Apr 26, 2005
  5. dotnw@hotmail.com
    Replies:
    0
    Views:
    142
    dotnw@hotmail.com
    Feb 11, 2005
Loading...

Share This Page