Page Refreshing Incorrectly

L

LisaMark0822

I have an asp page that gets populated from a SQL Server database. Normally
when the page gets displayed it displays the current record from a select
statement that can return lets say seven records.

The problem I am having is when I click the refresh button in IE, the page
displays another record instead of the record it was displaying before I
clicked on the refresh button.

I cannot figure out why it is doing this. Has anyone experienced a similar
problem? If so, what solution did you come up with.

Thanks

Mark
 
R

Ray Costanzo [MVP]

It's hard to say without seeing the code that you're using to pull in the
records.

Ray at work
 
L

LisaMark0822

What I have is on the prior page I display all the records returned from the
select statement, lets say 7. The user clicks on the record he wants (record
3 of 7) and it takes you to another page that displays the information from
the select statement. However, when I click the refresh button on the asp
page, when the page gets refreshed, it displays record 4, or 5 or 2 not the
current record that was displayed prior to the user clicking on the refresh
button. I hope that helps.

Thanks,

Mark
 
R

Ray Costanzo [MVP]

We still don't know how your page is determining what record to pull in. Is
there something in the querystring?

<% iRecordIDToDisplay = Request.Querystring("id") %>

Or something like that?

Is this page in frames, by chance?

Ray at work
 
D

Dave Anderson

LisaMark0822 said:
What I have is on the prior page I display all the records returned
from the select statement, lets say 7. The user clicks on the record
he wants (record 3 of 7) and it takes you to another page that
displays the information from the select statement. However, when I
click the refresh button on the asp page, when the page gets
refreshed, it displays record 4, or 5 or 2 not the current record
that was displayed prior to the user clicking on the refresh button.

Are you using an ORDER BY clause in your SELECT statement? More to the
point, are you ordering on a column that actually differentiates between
records?

Either way, it would be better to use an identity or primary key value for
identifying the record to display, since the Nth record of any SELECT
changes as the data changes.



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top