I am facing a problem storing original values of a form.
I have a form with number of Text boxes.All these textboxes binds with a single Entity.
For e.g.
Class Car
{
private int Light;
private int TailLight;
private int Seats;
private int Gears;
}
Now one text box will bind with Light, one with TailLight and so on.
On page load these text boxes are filled with some values, and user has an option to edit these text boxes and save the data. Now before saving these data i need to check the OriginalValues (on pageload) with the edited values. I am not able to find a way to store these original values anywhere. No matter where i save the original values the data get changed to the edited value at the end, i understand this is because we are giving reference.
Can anybody suggest a way to solve this……
Even after doing trial and error lots of different way i could not found a way to do this.
So i did te same by using DeepCopy, i.e. Seralizing and Deseralizing..
Hope this help others..