New Record Insert While page Refresh each time

Posted by Ramrao93 under C# on 1/24/2012 | Points: 10 | Views : 1926 | Status : [Member] | Replies : 12
If new record is added and then page is refresh then add duplicate record automaticallly.I solved this problem in many ways from code behind.
I solved this also by adding update panel on the page .but i dont understand why this problem occure because i think this is not proper way.
I think there is no need to add extra code to handle such problem .
so pls tell me if any suggessions




Responses

Posted by: Avdesh on: 1/24/2012 [Member] Starter | Points: 25

Up
0
Down
put this condition before you add a record in your code
if(!isPostBack)
{
Yourcode;
}


Your code will work fine

Ramrao93, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ramrao93 on: 1/24/2012 [Member] Starter | Points: 25

Up
0
Down
I put this section on page load but dont work that

Ramrao93, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Avdesh on: 1/24/2012 [Member] Starter | Points: 25

Up
0
Down
what is your code give me the source code.i will provide you the solution

Ramrao93, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 1/24/2012 [Member] Silver | Points: 25

Up
0
Down
http://aspalliance.com/687_Preventing_Duplicate_Record_Insertion_on_Page_Refresh.all#Page1

please have a look on this : 1 question many solutions.
:)
Sanjay

Thanks,
Sanjay

Ramrao93, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Avdesh on: 1/24/2012 [Member] Starter | Points: 25

Up
0
Down
ON SUBMITTING INSERT ON BUTTON CLICK CLEAR ALL THE TEXT BOXES WHICH ARE FILLED ON INSERTING INTO DATABASE
THANKS REGARDS
(AVDESH PAL)

Ramrao93, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 1/24/2012 [Member] Silver | Points: 25

Up
0
Down

Even you clear the controls and refresh the browser , it will keep on adding records unless their is unique constraint in database


Thanks,
Sanjay

Ramrao93, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Avdesh on: 1/24/2012 [Member] Starter | Points: 25

Up
0
Down
I HAVE USED IT IN MY PROJECT IT IS WORKING
THANKS REGARDS
(AVDESH PAL)

Ramrao93, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ramrao93 on: 1/24/2012 [Member] Starter | Points: 25

Up
0
Down
yaa u are rigtht . But tell me in general there is no occurance of such type of problem in normal insert.
there are few solution to overcome this prob but why occure this problem.

Ramrao93, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 1/24/2012 [Member] Silver | Points: 25

Up
0
Down

can you add a sample here?
will be really helpful.

Thanks,
Sanjay

Ramrao93, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ramrao93 on: 1/24/2012 [Member] Starter | Points: 25

Up
0
Down
can i call u after some time . i got ur no from ur resume

Ramrao93, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 1/24/2012 [Member] Silver | Points: 25

Up
0
Down
I asked AVDESH PAL to attach a sample if clear controls works to avoid duplicate entry on page refresh.
Thanks
sanjay



Thanks,
Sanjay

Ramrao93, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Drewbennet on: 1/31/2012 [Member] Starter | Points: 25

Up
0
Down
Despite a slowly-dropping unemployment rate, it's still a fiercely competitive job market. Job-seekers need to use every advantage in selling themselves to prospective employers. A crisp, up-to-date resume is a best calling card. If the job search is not going well, it might be time to look at yours and "refresh" it. Source of article: Refresh your resume to improve job search.

Ramrao93, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response