473,396 Members | 2,033 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.

Preventing Postdata when clicking refresh button

Hi,

Can anyone tell me how to prevent some particular POST DATA when
refresh button (F5) clicked on server side(vb.net).
Thanks
Kumar N

Nov 6 '07 #1
9 4124
Kumar,

What do you mean you want to prevent some particular post data? What
are you trying not to do?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Navaneet" <to********@gmail.comwrote in message
news:11**********************@22g2000hsm.googlegro ups.com...
Hi,

Can anyone tell me how to prevent some particular POST DATA when
refresh button (F5) clicked on server side(vb.net).
Thanks
Kumar N

Nov 6 '07 #2
Yes, i want to prevent only when refresh button get clicked.

Following is scenario where i am digging

1. There is xml file (Namely a.xml) which contains all the field
including hidden field.
2. There is a aspx file (Namely a.aspx) which having only vb.net code.
Depending on need it will parsing xml data on browser.
3. From some page a.aspx page get in action containg post data.
4. Now from a.aspx page calling a javascript function, at there we had
set a hidden attribute value to 1 (which is define in a.xml file) and
submitting the form which contains that hidden attribute value.
5. So depending on that attribute value a.aspx parse the a.xml.
6. Now when i refresh button (F5) press step-4 and 5 should be called.

My need, step-4 will not called when refresh button hit, it will
called only when step-4 explicitly called.

Please tell what i have to do to resolve this.

Thanking You a lot !
: Kumar N

On Nov 6, 8:39 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
Kumar,

What do you mean you want to prevent some particular post data? What
are you trying not to do?

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com

"Navaneet" <tonavan...@gmail.comwrote in message

news:11**********************@22g2000hsm.googlegro ups.com...
Hi,
Can anyone tell me how to prevent some particular POST DATA when
refresh button (F5) clicked on server side(vb.net).
Thanks
Kumar N- Hide quoted text -

- Show quoted text -

Nov 6 '07 #3
This may not be the most elegant idea, but it's the first that comes to mind.
1) the first time, set a Session Item that will be used to identify that the
page has already been posted (or whatever it is that you need to prevent
happening more than 1x)
2) On each subsequent Page_Load, you would check for the presence of the
Session Item from #1 above, and disallow the action if it is there.
-- Peter
http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Navaneet" wrote:
Yes, i want to prevent only when refresh button get clicked.

Following is scenario where i am digging

1. There is xml file (Namely a.xml) which contains all the field
including hidden field.
2. There is a aspx file (Namely a.aspx) which having only vb.net code.
Depending on need it will parsing xml data on browser.
3. From some page a.aspx page get in action containg post data.
4. Now from a.aspx page calling a javascript function, at there we had
set a hidden attribute value to 1 (which is define in a.xml file) and
submitting the form which contains that hidden attribute value.
5. So depending on that attribute value a.aspx parse the a.xml.
6. Now when i refresh button (F5) press step-4 and 5 should be called.

My need, step-4 will not called when refresh button hit, it will
called only when step-4 explicitly called.

Please tell what i have to do to resolve this.

Thanking You a lot !
: Kumar N

On Nov 6, 8:39 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
Kumar,

What do you mean you want to prevent some particular post data? What
are you trying not to do?

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com

"Navaneet" <tonavan...@gmail.comwrote in message

news:11**********************@22g2000hsm.googlegro ups.com...
Hi,
Can anyone tell me how to prevent some particular POST DATA when
refresh button (F5) clicked on server side(vb.net).
Thanks
Kumar N- Hide quoted text -
- Show quoted text -


Nov 6 '07 #4
Navaneet wrote:
Can anyone tell me how to prevent some particular POST DATA when
refresh button (F5) clicked on server side(vb.net).
Try search for Token pattern (or Synchronizer Token pattern).

Arne
Nov 8 '07 #5
Lew
Arne Vajhøj wrote:
Navaneet wrote:
>Can anyone tell me how to prevent some particular POST DATA when
refresh button (F5) clicked on server side(vb.net).

Try search for Token pattern (or Synchronizer Token pattern).
Keyword: "idempotent".

Make the transaction idempotent. Token pattern is a standard way to do that.

--
Lew
Nov 12 '07 #6
Lew wrote:
Arne Vajhøj wrote:
>Navaneet wrote:
>>Can anyone tell me how to prevent some particular POST DATA when
refresh button (F5) clicked on server side(vb.net).

Try search for Token pattern (or Synchronizer Token pattern).

Keyword: "idempotent".

Make the transaction idempotent. Token pattern is a standard way to do
that.
It is an artificial way of making it idempotent in cases where
it can not be done natural.

Arne
Nov 19 '07 #7
Lew
Navaneet wrote:
>>>Can anyone tell me how to prevent some particular POST DATA when
refresh button (F5) clicked on server side(vb.net).
Arne Vajhøj wrote:
>>Try search for Token pattern (or Synchronizer Token pattern).
Lew wrote:
>Keyword: "idempotent".

Make the transaction idempotent. Token pattern is a standard way to
do that.
Arne Vajhøj wrote:
It is an artificial way of making it idempotent in cases where
it can not be done natural.
It is a very powerful technique, and I was elated when I first read of it.
I'm not quite sure what you mean by "artificial", but I don't guess that you
mean that as a pejorative.

A couple of years back I had a rash of managers who wanted to mandate that the
team "disable the back button" or "disable the refresh button", a truly bad
idea and one that always created more problems than it solved. The Token
Pattern gave us the goal we wanted - that repeated submissions would not cause
repeated transactions. It eliminated the problems caused by trying to control
browser behavior from the server, not to mention it avoided breaking the
standard idiom that users expect of the back button.

The Token Pattern provide a straightforward, easily-implemented way to enforce
idempotency on our transactions.

--
Lew
Nov 19 '07 #8
Lew wrote:
Arne Vajhøj wrote:
>It is an artificial way of making it idempotent in cases where
it can not be done natural.

It is a very powerful technique, and I was elated when I first read of
it. I'm not quite sure what you mean by "artificial", but I don't guess
that you mean that as a pejorative.
I mean that certain operations are natural idempotent.

If it fires off a SQL statement:
UPDATE tbl SET flag = FALSE WHERE id = 123
then you don't need to do anything in the app code.

If it fires off:
UPDATE tbl SET flag = NOT flag WHERE id = 123
then you need to use token pattern in your code to achieve
the same effect. You make a non natural idempotent operation
artificially idempotent.

Arne

Nov 20 '07 #9
Lew
Arne Vajhøj wrote:
Lew wrote:
>Arne Vajhøj wrote:
>>It is an artificial way of making it idempotent in cases where
it can not be done natural.

It is a very powerful technique, and I was elated when I first read of
it. I'm not quite sure what you mean by "artificial", but I don't
guess that you mean that as a pejorative.

I mean that certain operations are natural idempotent.

If it fires off a SQL statement:
UPDATE tbl SET flag = FALSE WHERE id = 123
then you don't need to do anything in the app code.

If it fires off:
UPDATE tbl SET flag = NOT flag WHERE id = 123
then you need to use token pattern in your code to achieve
the same effect. You make a non natural idempotent operation
artificially idempotent.
That is very illuminating, thank you.

--
Lew
Nov 20 '07 #10

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

Similar topics

5
by: Bruce | last post by:
I have a number of forms that do significant work based on variables POSTed from the form. What is the common method of detecting and preventing this work from being done when the form is POSTed as...
8
by: CJM | last post by:
How do people go about preventing the user from submitting a form for a 2nd time? For example, the user submits a form, clicks on the back button, and the submits the form again. I have used...
4
by: Diane Selby | last post by:
Hi- I am developing an ASP.NET application that can take a few seconds to process the request from the user. We are looking for a client-side solution that will prevent users from resubmitting...
6
by: hemant.singh | last post by:
Hi all, I am trying to get a way by which I'll know exactly when user goes out of my site by clicking on close button in browser, So that w/e user click close button in browser, I can send a...
3
by: Jim in Arizona | last post by:
How can I prevent a second (or third or fourth) post into a database by someone clicking the refresh button on their browser? Basically, the user clicks a button called "New Log", which makes...
2
by: pingalkar | last post by:
In my application, on one form i m getting information from user and save this information , after saving this information again we loading that page. (At this moment if any one try to refresh this...
10
by: Martien van Wanrooij | last post by:
In a simple webshop application I am trying to check that the "shopping cart" only should be "filled" when you choose an article in "meerinfo.php" and click on a link to "winkelwagen.php". It...
1
by: ashokingroups | last post by:
Hi, My problem is well known to all. But, I couldn't able to get answer from anywhere either from my colleagues, or from forums. :( My problem is this: 1. I've 10 fields on the form, which...
2
by: chrisp | last post by:
I have an ASP.NET 2 page with a button that causes a credit card transaction to be authorised. The authorisation procedure may take a few seconds and so I want to prevent the user from clicking the...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.