Serialize Object To String
Copy this code and paste it in your HTML
public string SerializeToString<T>(T obj)
{
StringWriter sw
= new StringWriter
();
XmlSerializer serializer
= new XmlSerializer
(typeof(T
)); serializer.Serialize(sw, obj);
return sw.ToString();
}
Report this snippet
Comments
Subscribe to comments