473,511 Members | 15,818 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Back Button Revisited asp.net 2.0

19 New Member
I know, I know, I've read the posts, but I can't get it to work. Scenario is:
Page 1 = registration page
Page 2 = cc company page (I can't touch)
Page 3 = return page for cc company
Page 4 = my second page of receipt

Pages 1, 3, 4, all use my master page, wherein I have:
Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.Cache.SetExpires(DateTime.Now.AddDays(-1))
End Sub
.........and.....
<head id="Head1" runat="server">
<script language="javascript" type="text/javascript">
window.history.forward(1)
</script>

On each individual page for 1,2,3; I have:
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.Cache.SetExpires(DateTime.Now.AddDays(-1))
MyBase.OnPreRender(e)
Dim sb As New StringBuilder()
sb.Append("<script language=javascript>" & Chr(10) & "")
sb.Append("window.history.forward(1);" & Chr(10) & "")
sb.Append("" & Chr(10) & "</script>")
ClientScript.RegisterClientScriptBlock(Me.GetType, "clientScript", sb.ToString())
End Sub

And yet, when I go through the process and get to page 4, hit back button once, it takes me back to page 2.

Please help,
Janet
Mar 4 '08 #1
2 1113
MonaLisaO
13 New Member
Sorry it's hard to ready your post without the CODE tags, if you look to the right of the entry box the 3rd bullet down explains how to use them.

~mona
Mar 4 '08 #2
janetb
19 New Member
So sorry, does this help?

I know, I know, I've read the posts, but I can't get it to work. Scenario is:
Page 1 = registration page
Page 2 = cc company page (I can't touch)
Page 3 = return page for cc company
Page 4 = my second page of receipt

Pages 1, 3, 4, all use my master page, wherein I have:
Expand|Select|Wrap|Line Numbers
  1. Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
  2. Response.Cache.SetCacheability(HttpCacheability.No Cache)
  3. Response.Cache.SetExpires(DateTime.Now.AddDays(-1))
  4. End Sub
.........and.....
Expand|Select|Wrap|Line Numbers
  1. <head id="Head1" runat="server">
  2. <script language="javascript" type="text/javascript">
  3. window.history.forward(1)
  4. </script>
On each individual page for 1,2,3; I have:
Expand|Select|Wrap|Line Numbers
  1. Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
  2. Response.Cache.SetCacheability(HttpCacheability.No Cache)
  3. Response.Cache.SetExpires(DateTime.Now.AddDays(-1))
  4. MyBase.OnPreRender(e)
  5. Dim sb As New StringBuilder()
  6. sb.Append("<script language=javascript>" & Chr(10) & "")
  7. sb.Append("window.history.forward(1);" & Chr(10) & "")
  8. sb.Append("" & Chr(10) & "</script>")
  9. ClientScript.RegisterClientScriptBlock(Me.GetType, "clientScript", sb.ToString())
  10. End Sub
And yet, when I go through the process and get to page 4, hit back button once, it takes me back to page 2.
Mar 5 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

25
7527
by: KK | last post by:
Hi, I am using history.go(-1) for implementing the back button functionality. Its working fine but with this exception. 1. The page which is having back button has some hyperlinks on it. ...
1
4267
by: Peter D. Dunlap | last post by:
Hello, I realize that this may not be the best place to ask this question, through the application is asp.net. I also realize that questions about disabling the back button are generally met...
4
7584
by: Hypo | last post by:
I added a 'Back' button to my page, and wrote 'OnClick' code something like this: Response.Write("<script>history.go(-" + iDepthIndex.ToString() + ");</script>"); But, it dosnt work! Effect...
8
2544
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and...
6
10655
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. ...
29
3953
by: Tom wilson | last post by:
I can't believe this is such an impossibility... I have an asp.net page. It accepts data through on form fields and includes a submit button. The page loads up and you fill out some stuff. ...
6
1926
by: tshad | last post by:
I am trying to set up a Javascript popup box that has a way of sending back a message to asp.net on how to process some data. At the moment I am just doing: ...
5
2382
by: Tom wilson | last post by:
I'm developing an application that is a benefits enrolment website. The benefits can be of any type in any order as stored in a SQL server. On each page is a Back and Next button. At a certain...
7
2465
by: Sridhar | last post by:
Hi, I have a question regarding the Page_Load method and Back Button of Internet explorer. I have created a webform. In that webform I have several Text Boxes. Also I have two buttons. When I...
0
7252
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
7093
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5676
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1583
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.