Click here to Skip to main content
Sign Up to vote bad
good
See more: C#2.0ASP.NET
How to stop the recurrence of event at page refresh in asp page.
when we click on some button it does its click event but after that when we refresh the page then it also clicked automatically. How can It may be solved ?
 
Browser should not store my previous click event.
Posted 24 Oct '12 - 22:20
Edited 24 Oct '12 - 22:49


2 solutions

Hi,
If u have acess to the Data Layer (database), u can write a stored procedure, which does the checking, whether the record exists, and do the insert (or skip) accordingly and return, the existence in a way u prefer.
You may do that as you do it now in the code, but it may not be the "standard coding".
"is Not" is inside a string and is doing nothing other than being inside a string, in C# side. It comes into play one passed to Database server (interprets it as SQL statements)
 
Or you can also see Page Refresh Causes Duplicate POST in ASP.NET Applications[^]
 

Hope it helps!
--Amit
  Permalink  
Comments
braj mohan sharma - 25 Oct '12 - 5:31
I am not using any database. I am calling popup, that should be called only once.On page refresh it should not be called.
_Amy - 25 Oct '12 - 5:36
Are you using server side button click event to open the popup?
Teju MB - 25 Oct '12 - 7:08
Good going Amit..! my 5 !
_Amy - 25 Oct '12 - 7:08
Thanks Teju. :)
Teju MB - 25 Oct '12 - 7:09
Under E-underwrite Code project too ?
Try to put on the Page load !IsPostback () { //whatever codes you're doing in here }
  Permalink  
Comments
braj mohan sharma - 25 Oct '12 - 4:41
I know this...but browser is still asking for Retry or cancel your event again.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 8,356
1 OriginalGriff 6,571
2 CPallini 3,533
3 Rohan Leuva 2,703
4 Maciej Los 2,234


Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 25 Oct 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid