473,320 Members | 1,978 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,320 software developers and data experts.

Refresh repeats last action

I am writing a content management system where users can remove and
edit data. I have a datagrid with a 'remove' button on each row. If a
user clicks this (or 'add new', or 'edit') it works fine. However, if
they then press refresh on their browser, .NET attempts to repeat the
last action, which really messes things up. Is there a way to signal
NET that, for example, an OnClick event shouldn't occur again upon
refresh? Thanks.

Nov 18 '05 #1
3 2832
This is a browser feature. It repeats the last postback whatever it was. You
can't get browser to change it's behavior. You should rather implement a
sort of protection against this in your code.

Eliyahu

"kj12345" <ke********@usa-dot-com.no-spam.invalid> wrote in message
news:41**********@Usenet.com...
I am writing a content management system where users can remove and
edit data. I have a datagrid with a 'remove' button on each row. If a
user clicks this (or 'add new', or 'edit') it works fine. However, if
they then press refresh on their browser, .NET attempts to repeat the
last action, which really messes things up. Is there a way to signal
NET that, for example, an OnClick event shouldn't occur again upon
refresh? Thanks.

Nov 18 '05 #2
What about my "add a new record" button, though? It's perfectly
reasonable for someone to add two records in a row, so it seems to be
nearly indistiguishable from clicking "refresh"? (Thanks for the
response anyway, that clarifies things.)

Nov 18 '05 #3
Understand. May be a timestamp could help? When adding a record, provide a
timestamp in a hidden field and store it on the server. Check the timestamp
in every new "add record" request against the previous one.

Eliyahu

"kj12345" <ke********@usa-dot-com.no-spam.invalid> wrote in message
news:41********@Usenet.com...
What about my "add a new record" button, though? It's perfectly
reasonable for someone to add two records in a row, so it seems to be
nearly indistiguishable from clicking "refresh"? (Thanks for the
response anyway, that clarifies things.)

Nov 18 '05 #4

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

Similar topics

0
by: P Mitchell | last post by:
Hello I would like someone to be able to help with the updating of data in a lookup list in a subform. In short, is their a VB instruction that is the equivalent of performing the action of...
2
by: Raj | last post by:
Hi All, I have a problem with trying to refresh the parent window from child window in order to update data in the parent window. The sequence of events are 1) I click a button in the parent...
4
by: wright | last post by:
hello, i have a problem in refreshing a page. the problem happens when i click a button that does a certain action in a web page, such as inserting a record into the database, if now i refresh the...
4
by: Paul W | last post by:
For debugging purposes, I have the following in Page_load: Response.Write("postback is " + IsPostBack.ToString + Now.ToLongTimeString) i When I view my page in IE, if I hit F5 (refresh), it...
4
by: D. Shane Fowlkes | last post by:
This may be a very simple question but I'm stumped none the less. I have a form where a user provides comments. There's a Grid below this form which displays all comments in the table so far. On...
2
by: Amelyan | last post by:
How do you prevent browser "Refresh" action from repeating the last operation (e.g. button click event) of my aspx page?
9
by: Mr Newbie | last post by:
Before someone flames me, I know this is the VB.NET groups, nonetheless, the asp.net guys seems to have almost disapeared from the aspnet groups so I thought I would ask this here. I have a...
4
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi. If an ASP.NET page postsback, for example, after a button is clicked, and then I refresh the page (ie, by pressing F5 key), why does the same event occur when I press F5 as it did when I...
10
by: Piotr Nowak | last post by:
Hi, Say i have a server process which listens for some changes in database. When a change occurs i want to refresh my page in browser by notyfinig it. I do not want to refresh my page i.e....
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.