childpage.aspx is my aspx page. private static string GetSerialized(object objToSerialize) { BinaryFormatter bFormatter = new BinaryFormatter(); MemoryStream mStream = new MemoryStream(); byte[] brTemp; string strSerializedObject; try { bFormatter.Serialize(mStream, objToSerialize); brTemp = mStream.ToArray(); strSerializedObject = Convert.ToBase64String(brTemp); return strSerializedObject; } catch(Exception ex) { return null; } finally { bFormatter = null; mStream = null; brTemp = null; } }
the above method helps me to serialize the objects. when i call GetSerialized(this)
in my aspx page it is throwing the below exception ex {"Type 'ASP.childpage_aspx' in Assembly 'App_Web_wzfanznh, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable."} System.Exception {System.Runtime.Serialization.SerializationException} do you have any idea about this? thanks and regards
Ramesh.Kanjinghat