Refresh Page Adds More Child Objects

Refresh Page Adds More Child Objects

Old forum URL: forums.lhotka.net/forums/t/2036.aspx


MadGerbil posted on Wednesday, December 27, 2006

Hi:

Just wondering if anyone had a good solution for the tendency of the system to add duplicate objects to my collections upon page refresh.   This happens if an 'Add' button is used to create a child object that is placed into a collection.  If the 'Refresh' button is hit the entire 'Add' routine fires again.

I can come up with a couple of haxxor ways around it, just wondering if there is something elegant out there.

For example, under no circumstances should any of my objects be identical so I could create a 'compare' based on all the properties - seems kind of haxxor to me though.   Someone got something better?

JoeFallon1 replied on Thursday, December 28, 2006

I use the RefreshTrapper HttpModule from Dino Esposito.

He wrote an article on it a while back. I am sure Google can find it.

The basic idea is to detect when a Refresh occurs and treat it differently than a postback.

Should solve the problem you are seeing.

 

Copyright (c) Marimer LLC