data inserted again after refresh

S

SOW Olivier

Hi,

I'm begin in ASP.NET.
I use a gridView and DetailView in a same page,

I add a button which set DetailView in InsertMode.
When i click insert button in the DetailView, data are stored fine in my DataBase.

But if I refresh the page juste after the insert, data are inserted again in the Database.

When I worked with ASP3 in this case, i just do a redirection after inserting data with:
Response.Redirect(Request.Path+"?insert=1")

But if i do that with ASP.NET, when i select a next page in the GridView, insert=1 stay in the QueryString.

I'm sure i don't use the correct way to forbid double insert, can someone help ?

many thanx
 
M

Muhammad Mosa

Set the SmartNavigation of your Page to true, this will enable your to
referesh the page without posting your data back .
it is working in both ASP.Net 1.x & ASP.NET 2.0 but I'm not sure if it will
be supporeted in next releases or they will replace it with something else
--
Muhammad Mosa
Software Engineer & Solution Developer
MCT/MCSD.NET
MCTS: .Net 2.0 Web Applications
MCTS: .Net 2.0 Windows Applications
 
H

hasan.ozdil

SmartNavigation is now obsolete... what is the new directive ? They say
in the msdn that mainscrollposition and setfocus are the new properties
but they doesn't affect the "multi insert" problem when clicking on the
refresh button

Have you an idea of the new property that avoids this problem?

Muhammad Mosa a écrit :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top