![]() |
|
|
|||||||
![]() |
ASP Net - How to use Response.Redirct like a browser back button? |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
What is the difference between the two?
I have a page "one" with a button using Response.Redirect("pagetwo.asxp") to go to the next page. On page two I have a button using Response.Redirect("pageone.aspx") to go back to page one. When I view page one, select some information, then go to page two, and then select the back button (using the response.redirect) none of my selections remain. If I just use the back button of the web browser everything works fine. Anything I am doing wrong? Thanks. Michelle A. |
|
|
|
|
#2 |
|
Posts: n/a
|
Kevin is right.
To get it to work like the back button, Instead of using Response.Redirect to go back to page one you could execute some client side javascript like this: history.go(-1); So you could have a "Back" anchor tag in your HTML that looks like this: <a href='javascript:history.go(-1);'>Back</a> Here's more info: http://www.devguru.com/Technologies/...istory_go.html -- I hope this helps, Steve C. Orr, MCSD http://Steve.Orr.net Hire top-notch developers at http://www.able-consulting.com "Michelle A." <> wrote in message news:... > What is the difference between the two? > > I have a page "one" with a button using Response.Redirect("pagetwo.asxp") to > go to the next page. > > On page two I have a button using Response.Redirect("pageone.aspx") to go > back to page one. > > When I view page one, select some information, then go to page two, and then > select the back button (using the response.redirect) none of my selections > remain. If I just use the back button of the web browser everything works > fine. > > Anything I am doing wrong? > > Thanks. > > Steve C. Orr, MCSD |
|
|
|
#3 |
|
Posts: n/a
|
One caution about using JavaScript history, though: With ASP.Net it can have
unexpected results, as ASP.Net WebForms submit to themselves, and have different ViewState data in them at different times. -- HTH, Kevin Spencer Microsoft MVP ..Net Developer http://www.takempis.com The more I learn, the less I know. "Steve C. Orr, MCSD" <> wrote in message news:... > Kevin is right. > To get it to work like the back button, Instead of using Response.Redirect > to go back to page one you could execute some client side javascript like > this: > history.go(-1); > > So you could have a "Back" anchor tag in your HTML that looks like this: > <a href='javascript:history.go(-1);'>Back</a> > > Here's more info: > http://www.devguru.com/Technologies/...istory_go.html > > -- > I hope this helps, > Steve C. Orr, MCSD > http://Steve.Orr.net > Hire top-notch developers at http://www.able-consulting.com > > > > "Michelle A." <> wrote in message > news:... > > What is the difference between the two? > > > > I have a page "one" with a button using Response.Redirect("pagetwo.asxp") > to > > go to the next page. > > > > On page two I have a button using Response.Redirect("pageone.aspx") to go > > back to page one. > > > > When I view page one, select some information, then go to page two, and > then > > select the back button (using the response.redirect) none of my selections > > remain. If I just use the back button of the web browser everything works > > fine. > > > > Anything I am doing wrong? > > > > Thanks. > > > > > > Kevin Spencer |
|
|
|
#4 |
|
Posts: n/a
|
Cool..
I will take a look at that on Monday.. Thanks. "Steve C. Orr, MCSD" <> wrote in message news:... > Kevin is right. > To get it to work like the back button, Instead of using Response.Redirect > to go back to page one you could execute some client side javascript like > this: > history.go(-1); > > So you could have a "Back" anchor tag in your HTML that looks like this: > <a href='javascript:history.go(-1);'>Back</a> > > Here's more info: > http://www.devguru.com/Technologies/...istory_go.html > > -- > I hope this helps, > Steve C. Orr, MCSD > http://Steve.Orr.net > Hire top-notch developers at http://www.able-consulting.com > > > > "Michelle A." <> wrote in message > news:... > > What is the difference between the two? > > > > I have a page "one" with a button using Response.Redirect("pagetwo.asxp") > to > > go to the next page. > > > > On page two I have a button using Response.Redirect("pageone.aspx") to go > > back to page one. > > > > When I view page one, select some information, then go to page two, and > then > > select the back button (using the response.redirect) none of my selections > > remain. If I just use the back button of the web browser everything works > > fine. > > > > Anything I am doing wrong? > > > > Thanks. > > > > > > Michelle A. |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Disabling Back Button and Refresh Buttons | tessythampan | Software | 1 | 12-18-2007 09:13 PM |
| Back button doesn't work when it is a secure page returning to a non secure page | Miss Mary | General Help Related Topics | 1 | 09-21-2007 10:32 AM |
| Re: Faulty PC power button | WinXP_Powered | A+ Certification | 5 | 03-09-2006 07:51 AM |
| Re: Faulty PC power button | Christopher Range | A+ Certification | 0 | 02-25-2006 12:02 AM |
| New releases: Fox two pack blitz, WB 3 packs: Updated complete downloadable R1 DVD DB & info lists | Doug MacLean | DVD Video | 0 | 08-19-2003 05:39 AM |