i have applied edit,delete,update,insert operation successfully,everything is work Correctly.
But when i refresh the page,last operation performed again after refresh .
suppose when i updated any record before refresh ,one insertion took place after refresh .
when i inserted record before refresh page.same record inserted again...i have no idea why has been this happening.
if anybody want to see my code,i will show..
Thanks in advance
Loading

Sompal AryaPosted Mar 19, 2014, 3:47 AM
Lakshmanan Sethu SankaranarayanPosted Mar 19, 2014, 3:27 AM
Sompal AryaPosted Mar 19, 2014, 1:53 AM
Abhay ShankerPosted Mar 19, 2014, 1:40 AM
If you refresh the page,last operation performed again which is adding a record to the db in this case.
You have to check with the db for the existence of the record before inserting it to avoid this.
Secondly, If you need your Gridview to be updated with last entered value you need to re-bind the Gridview after entering the record.
Remove the databinding code from Page_Init method and create a new method with same code say BindGrid() on Page_Load
Also, add BindGrid(); as the last line of Button1_Click() method