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

Refreshing the page after posting issue

Apparently, asp.net has a posting issue with refreshing. There seems
to be several solutions to the issue but I was wondering if there is a
final workaround for the issue?

If so, can you please inform me what I need to do?
I'm using ASP.NET 2.0 beta

Nov 19 '05 #1
8 1748
"-Karl" <di*****@gmail.com> wrote in message
news:11*********************@c13g2000cwb.googlegro ups.com...
Apparently, asp.net has a posting issue with refreshing. There seems
to be several solutions to the issue but I was wondering if there is a
final workaround for the issue?

If so, can you please inform me what I need to do?
I'm using ASP.NET 2.0 beta


Can you please tell us what you're talking about? "a posting issue with
refreshing" is pretty vague.

John Saunders
Nov 19 '05 #2
Simple. You have a form. You fill out the form. You submit the form.
You refresh the page and see another submition.

In my case, I am trying to insert some data. Refrshing the page after
submitting the data results in duplicate data being entered. This
happens with any type of form submition. The action gets refreshed. I
need to know how to prevent this from happening.

I could code in major checks when submitting the form but that seems
rather overkill on coding. Surely there is a simplier method?

Nov 19 '05 #3
PK9
Have you found an answer to this? I'm having a similar problem. I noticed
that when the user clicks a button (Save for instance), and then clicks the
"Refresh" button on the browser, the onClick event handler for my "Save"
button gets kicked off again! I think this is similar to the issue you're
having, correct? I thought asp.net was supposed to be stateless in that it
wasn't supposed to remember what "action" (i.e. onClick event) you did last.
It should just refresh and hit the Page_Load event handler again where you
can check for a postback. Any help would be appreciated if you've got any
further understanding.

"-Karl" wrote:
Simple. You have a form. You fill out the form. You submit the form.
You refresh the page and see another submition.

In my case, I am trying to insert some data. Refrshing the page after
submitting the data results in duplicate data being entered. This
happens with any type of form submition. The action gets refreshed. I
need to know how to prevent this from happening.

I could code in major checks when submitting the form but that seems
rather overkill on coding. Surely there is a simplier method?

Nov 19 '05 #4
No, no one seems to want to post the solution and the web doesn't have
any solutions.

While it' annoying and sometimes dangerous, I have become used to the
issue for now but I can not design any pages for production like this
or else I'll have major issues,

Nov 19 '05 #5
=?Utf-8?B?UEs5?= <PK*@discussions.microsoft.com> confessed in
news:E5**********************************@microsof t.com:
Have you found an answer to this? I'm having a similar problem. I noticed that when the user clicks a button (Save for instance), and then clicks the "Refresh" button on the browser, the onClick event handler for my "Save"
button gets kicked off again! I think this is similar to the issue you're having, correct? I thought asp.net was supposed to be stateless in that it wasn't supposed to remember what "action" (i.e. onClick event) you did last. It should just refresh and hit the Page_Load event handler again where you can check for a postback. Any help would be appreciated if you've got any further understanding.

"-Karl" wrote:
Simple. You have a form. You fill out the form. You submit the form.
You refresh the page and see another submition.

In my case, I am trying to insert some data. Refrshing the page after
submitting the data results in duplicate data being entered. This
happens with any type of form submition. The action gets refreshed. I
need to know how to prevent this from happening.

I could code in major checks when submitting the form but that seems
rather overkill on coding. Surely there is a simplier method?


OK, simple.

Redirect to a completion page after data has been stored and confirmed.

If you like, you can send querystring parameters with the data to this page
and display them, or the page can say, simply: "Thank you."

Anyway, no danger of refresh reloading data.

You might also consider using constraints in your database to prevent
duplicates.

-- ipgrunt
Nov 19 '05 #6
Under normal circumstances, that would be ok. However, in my case, the
form and results are on the same page. I guess I could redirect them
to another page which would then redirect them BACK to the form /
result page. I was thinking there was an simplier method

With the constraints, the only way I know of checking for duplicates is
to perform a Select query to see if there are any duplicates in the DB.
But isn't there a simplier way to verify there is no entry?

Thanks!

Nov 19 '05 #7
"-Karl" <di*****@gmail.com> confessed in news:1106855851.293868.135010
@f14g2000cwb.googlegroups.com:
Under normal circumstances, that would be ok. However, in my case, the
form and results are on the same page. I guess I could redirect them
to another page which would then redirect them BACK to the form /
result page. I was thinking there was an simplier method

With the constraints, the only way I know of checking for duplicates is
to perform a Select query to see if there are any duplicates in the DB.
But isn't there a simplier way to verify there is no entry?

Thanks!


Well yes, you use a database constraint. In SqlServer it's called a UNIQUE
constraint.

Primary keys are by definition UNIQUE constraints. You can also apply UNIQUE
constraints to other columns or sets of columns (take care with this, as you
build BIG indices this way).

If you use, for example, an email addresses as a primary key, and then try to
insert a record containing an email that's already in the index, the db will
cry foul.

-- ipgrunt

Nov 19 '05 #8
mmmm... interesting approach. One that I never thought to look at.
I'd have to see how to catch the error and be able to inform the user
the record already exists.... But this is a start, thanks!

Nov 19 '05 #9

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

Similar topics

5
by: Wayne Wengert | last post by:
I have a menu that calls a specific asp page and passes a variable data1page.asp?year=2001 where the value of the year variable is determined in code. This works fine the first 2 times I...
60
by: A.Translator | last post by:
I have been struggling with a page that is based on a table structure (because that is all I am feeling comfortable with at the moment) styled with css. One of the problems I run in to is Opera...
1
by: Hans | last post by:
I have a Windows.Forms.Form containing a DataGrid where the DataSource is a DataView. Everything refreshes fine after adding, deleting or editing rows. When I close the dialog and reopen it with a...
7
by: A.M | last post by:
Hi, I want to refresh my DataGrid data on every postback. I have following code in Page_Load event, but after first page load, the DataGrid never gets refresh. Here is the code i have in...
7
by: Daniel Walzenbach | last post by:
Hi, when I start my asp.net page for the first time I almost always get the following output: form name="Form1" method="post"
6
by: =?Utf-8?B?V2F5RG93blVuZGVy?= | last post by:
When I link an ObjectDataSource to a business object, it appears that the Refresh Schema button does nothing. I have added a property to the business object and want to display this new property...
13
by: honey99 | last post by:
Hi! I have to fix a problem in JSP.Actually,i have a JSP page say Ex1.jsp.In this Ex1.jsp i have an anchor tag which links into another JSP page i.e when i click on the link another pop-up window...
8
by: CF FAN | last post by:
We have an issue with refreshing pages using JavaScript. We have got three pages. From page 1, page 2 is opened by window.open and from page 2, page 3 open up by window.open and also closes page 2....
3
by: gsuns82 | last post by:
Hi all, I am using modal window for some update purpose, the issue i am facing is,i am not able to refresh parent after closing modal window. The code i used: ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.