G
Guest
asp.net, visual studio 2003, IE6
I have a sample web page that is linked to another page. On the first page,
I have a text box, on the second, the first page's text box text is displayed
using a session variable. This works fine. However, when I return to the
first page, the text box content is blank.
If, prior to going to the second page, I hit 'refresh', the text disappears.
If I add a button control to the page, and click it before refreshing the
page, the text will reappear in the textbox.
If I then go to the second page and then back to the first, the textbox is
again blank.
I have added another text box that displays an incrementing counter (ie:
each time the button is clicked, the number displayed goes up by one). This
displays exactly the same behaviour as the other text box, except it will
show the next number after displaying a blank on return to the page (after
clicking the button again).
The session variable seems to be working ok, so I suppose the problem lies
with how I am trying to get it to display the textbox text.
Here's the code (currently included in the button_click event, but works the
same in page_load):
If Not Page.IsPostBack Then
Session("textinput") = TextBox1.Text
TextBox1.Text = Session("textinput")
End If
any thoughts?
I have a sample web page that is linked to another page. On the first page,
I have a text box, on the second, the first page's text box text is displayed
using a session variable. This works fine. However, when I return to the
first page, the text box content is blank.
If, prior to going to the second page, I hit 'refresh', the text disappears.
If I add a button control to the page, and click it before refreshing the
page, the text will reappear in the textbox.
If I then go to the second page and then back to the first, the textbox is
again blank.
I have added another text box that displays an incrementing counter (ie:
each time the button is clicked, the number displayed goes up by one). This
displays exactly the same behaviour as the other text box, except it will
show the next number after displaying a blank on return to the page (after
clicking the button again).
The session variable seems to be working ok, so I suppose the problem lies
with how I am trying to get it to display the textbox text.
Here's the code (currently included in the button_click event, but works the
same in page_load):
If Not Page.IsPostBack Then
Session("textinput") = TextBox1.Text
TextBox1.Text = Session("textinput")
End If
any thoughts?