Very strange: I use Server.transfer to post information to a new page with sessions. It's also possible to use response.redirect with this.
My problem is, that when I run the application (webform1.aspx as startpage), type some text and clicks the button, then webform2.aspx is shown, fine. But when I click BACK, webform1.aspx is shown, but WITHOUT the text that I entered.
My code is:
Webform1:
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Session("test") = Me.TextBox1.Text
Server.Transfer("webform2.aspx")
End Sub
Webform2:
Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
TextBox1.Text = Session("test")
End Sub
I don't think so. One of my collegues sent me the code and when HE runs the application the textbox on webform1.aspx remain when you click Back. That's what he says. I haven't seen it myself.
I can't believe that the form reloads when you click Back, is that true?
Okay I don't know. My pages keep the data when I hit back. I was thinking of the iframe on my rich edit control it goes empty because the javascript doesn't run.
no I'm using the original release of VS.Net Enterprise Arch. Just a warning btw. I have have a user control with allot of buttons and panels. It works great until I turn on SmartNav Then I get script errors caused by the smart nav javascript. I don't know if it's my Nav script include or what, but all smart nav supposidly does is remove the flicker between postbacks for ie5.5 or higher. So I don't bother with it since people on mac's and using non ie browsers don't get the effect anyway.
Right, I have also turned off the SmartNav again, if I use this and Server.Transfer it's not possible to go back.
It's still a mystery to me why it doesn't work, I have attatched my code, you can try it and see if the text remains "test app" when you enter that on page1.
I am using VS2002 Proff.