473,396 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Simple Beginner Question (I believe)

VS 2003, C# if the language matters.
Scenario:
Two page project, text box content on the start page is loaded into session
variables to be displayed in a greeting on the second page. Works fine the
first trip.
If upon return from the second page to the start page, the user enters new
data into the text boxes and then navigates (code in the navButton_Click
event procedure loads the session variables) to the second page, the old
data is still displayed.
Stepping through in the debugger seems to indicate that new data entry into
the text boxes does not cause the start page to be redrawn, thus the new
data shown in the interface is never transferred to the text property of the
text boxes?

Any thoughts appreciated!
Apr 22 '06 #1
5 1143
The start page is not "redrawn," it is created when a PostBack occurs. Are
you re-setting the Session variables prior to doing your redirect?

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"pvdg42" <pv****@newsgroups.nospam> wrote in message
news:ug****************@TK2MSFTNGP04.phx.gbl...
VS 2003, C# if the language matters.
Scenario:
Two page project, text box content on the start page is loaded into
session variables to be displayed in a greeting on the second page. Works
fine the first trip.
If upon return from the second page to the start page, the user enters new
data into the text boxes and then navigates (code in the navButton_Click
event procedure loads the session variables) to the second page, the old
data is still displayed.
Stepping through in the debugger seems to indicate that new data entry
into the text boxes does not cause the start page to be redrawn, thus the
new data shown in the interface is never transferred to the text property
of the text boxes?

Any thoughts appreciated!

Apr 22 '06 #2

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:OW**************@TK2MSFTNGP02.phx.gbl...
The start page is not "redrawn," it is created when a PostBack occurs. Are
you re-setting the Session variables prior to doing your redirect?

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

Yes, I believe so. The code in the click event procedure for the navigate
button is:

Session[ "name" ] = txtName.Text;

Session[ "phonenumber" ] = txtPhoneNumber.Text;

// redirect to RoadTestRegistered.aspx page

Response.Redirect( "RoadTestRegistered.aspx" );

This works fine the first time the user fills in the text boxes and
navigates to the second page. If the user then returns to the first page and
enters new information in the text boxes, the app acts as it the new entries
have been ignored when the navigate button is clicked the second time. The
old (first entries) information reappears on the second page.
Apr 22 '06 #3
How is the user returning to the first page?

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"pvdg42" <pv****@newsgroups.nospam> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:OW**************@TK2MSFTNGP02.phx.gbl...
The start page is not "redrawn," it is created when a PostBack occurs.
Are you re-setting the Session variables prior to doing your redirect?

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

Yes, I believe so. The code in the click event procedure for the navigate
button is:

Session[ "name" ] = txtName.Text;

Session[ "phonenumber" ] = txtPhoneNumber.Text;

// redirect to RoadTestRegistered.aspx page

Response.Redirect( "RoadTestRegistered.aspx" );

This works fine the first time the user fills in the text boxes and
navigates to the second page. If the user then returns to the first page
and enters new information in the text boxes, the app acts as it the new
entries have been ignored when the navigate button is clicked the second
time. The old (first entries) information reappears on the second page.

Apr 22 '06 #4

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:OF**************@TK2MSFTNGP04.phx.gbl...
How is the user returning to the first page?

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

1. I appreciate you bearing with me :)

2. Via Response.Redirect()
And, I now see that if the browser back button is used instead, the new
values *do* get recognized. Looks like I need a hammer and am trying to use
a screwdriver.
Thanks very much.
Apr 23 '06 #5
Hi Pvdg42,

I agree that the client-side browser's back/forward button is the cause.
When we use back/forward button on client-side browser to navigate page, it
will used the cached item and data in client-side's browser cache, so this
may not works as expected, we can output some http header to prevent
client-side caching, e.g:

#How to prevent caching in Internet Explorer
http://support.microsoft.com/kb/234067/en-us

it provide the example on ASP pages, and ASP.NET also support this (and
provide the Response.Cache property which provide more features on cache
control).

Hope this also helps.

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Apr 24 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Art | last post by:
NEWBIE ALERT! Esteemed List Participants and Lurkers: (System: P-II 350, 192 meg, Win98 SE, Python 2.2.3, wxPythonWIN32-2.4.1.2-Py22.exe) I'm having a lot of fun getting started with Python...
0
by: Dave | last post by:
I created a C# ASP.Net project in Visual Studio 2003 called CS1. When I navigate to http://localhost/CS1/webform1.aspx, my new ASP.Net web page displays fine. But I want to rename the page to...
1
by: Dave | last post by:
This is pretty basic but here goes: Is there a shortcut for typing text for a label? Every example I've seen requires you to go to the property window, select the name property value and then...
2
by: needin4mation | last post by:
I am looking for a good book on C# that has what an interface is and how to use it. In my local library they have a lot of Java books. Is an interface a C# thing or an OOP thing? So that if I...
2
by: Jack | last post by:
Hi there, I'm a very experienced C++ developer but a relative newcomer to web development and a raw neophyte in the ASP.NET arena. I have a very simple scenario that hopefully someone can help...
3
by: jmDesktop | last post by:
This program: s = 'abcde' i = -1 for i in range (-1, -len(s), -1): print s, i gives abcd -1
3
by: Ben Keshet | last post by:
I have a probably simple beginner's question - I have a script that I am currently able to print its output. instead, i want to write it into a file - I tried different versions of write() but...
2
by: nicholas08 | last post by:
I am new to programming and trying to work on a simple console app. I am making a simple Library Management system where the user/admin can manage members and item. Attaching the menu so it's clear...
2
by: PHPstarter | last post by:
I have this line, to select a controlled number of values. $result = mysql_query("SELECT * FROM AFL_BoE_Chapters WHERE ((boe_type='Chapter Index List') AND ('boe_required_level' >= '".$lvl."' ))...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
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,...

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.