Author: jode | Posted on: 9/8/2009 5:20:07 PM | Views : 345

Hi!


I am having a problem with Serialization and references.
It took me 2 hours to find that my problem was lying on Serialization of objects.
The point is that I can't make object Equals when they are serialized on different points of the project.
When I turn my SavePersistentMedium to the Session variable, it works fine because it doesn't change the GetHashCode whenever and wherever my variable are saved.
Here is a simple project to show my problem... the aspx is just a form with a button to do a postback



using System; using System.Web.UI; namespace WebApplication1 { public partial class _Default : System.Web.UI.Page { private string ViewStateCustomKey = string.Empty; [Serializable] class t { } t a; protected void Page_Load(object sender, EventArgs e) { t b; if (!IsPostBack) a = new t(); if (IsPostBack) { Response.Write((a = ...

Go to the complete details ...