473,473 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

refresh page causes a new insert into table

Jan
Hi,

I've made a web form (C#) with a 'save' button on the bottom of the form.

when the user saves (button click) the data it is inserted into a db table.
I notify the user with a javascript alert and the save button will be
disabled.
The text boxes are still filled with the input of the user.

When I press F5 (refresh) the form wants to save the data again!?

I hoped the text boxes where cleared and the browser showed a new empty
'instance' of the form...

Any ideas how this can be done..?

Cheers
Nov 10 '06 #1
1 1059
After the insertion, you can "redirect" to the current page...

You can also store the user's last action (hero) in a viewstate field in
order to test if the requested action is not the same than the last executed
one...

HTH.
Steve
"Jan" <Ja*@discussions.microsoft.coma écrit dans le message de news:
99**********************************@microsoft.com...
Hi,

I've made a web form (C#) with a 'save' button on the bottom of the form.

when the user saves (button click) the data it is inserted into a db
table.
I notify the user with a javascript alert and the save button will be
disabled.
The text boxes are still filled with the input of the user.

When I press F5 (refresh) the form wants to save the data again!?

I hoped the text boxes where cleared and the browser showed a new empty
'instance' of the form...

Any ideas how this can be done..?

Cheers

Nov 15 '06 #2

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

Similar topics

3
by: Dave Smithz | last post by:
Hi there, Working on the PHP DB I took over I have just come across a problem. When the user presses refresh in some circumstances the command they just performed will be re-performed. In some...
2
by: User | last post by:
Hi ! I have a sql insert function with a buttonin my page, and when i click on refresh button of IE. When i click my button, i have a new records but after when i click on the refresh button of IE...
0
by: Brad White | last post by:
Overview: I have a custom web app that has an 'Inbox' that refreshes every 30 seconds. One user uses Outlook to host the web page. Using IE, the refresh works fine. If the user is working in...
17
by: Jim Little | last post by:
Hello, I'm driving myself crazy either because I'm missing something about ASP.NET, or what I'm trying to do simply can't be done. First, I am not using session variables to track state. My...
10
by: jaYPee | last post by:
I have a function that call a stored procedure which performs an insert command. now i want to refresh the dataset so that the newly inserted data will be available to my datagrid I have tried...
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...
3
by: Brad Isaacs | last post by:
ASP.NET 2.0 / SQL Server 2000 db / Visual Basic Code behind On my .aspx page I have added an SQL Datasource that contains the SQL query to retrieve the list for my Drop Down List Box. Using...
5
by: SimonZ | last post by:
When user insert some data on page and click save button this data is inserted to database. If he clicks refresh button, the data is saved again each time when he clicks this button. I would...
2
by: =?Utf-8?B?U2lsa0NpdHlGbG9yaWRh?= | last post by:
I have a web page "PgA" with a GridView. I open another page "PgB" in a new window. On PgB, they do some things that affect the underlying data for the GridView on PgA. When the user is done...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.