I have a JSON string as :
var jsonString = JSON.stringify(dataObject);
document.getElementById("hdnChromedata").value = jsonString;
==> hdnChromedata = JSON string
BUT in a different code section I am storing XML serialized string to "hdnChromedata" .as :
XmlSerializer xmlSerializer = new XmlSerializer(vinDescription.GetType());
StringWriter textWriter = new StringWriter();
xmlSerializer.Serialize(textWriter, vinDescription);
this.hdnChromedata.Value = textWriter.ToString();
==> hdnChromedata = XML string
AND while retriving the values I am deserializing the string like this :
XmlDocument doc = new XmlDocument();
doc.LoadXml(this.hdnChromedata.Value);
XmlNodeReader reader = new XmlNodeReader(doc.DocumentElement);
XmlSerializer ser = new XmlSerializer(decodedInfo.GetType());
object textObj = ser.Deserialize(reader);
vinDescription = (AutoExact.AEVINDecoderService.VINDescription)textObj;
HERE the line doc.LoadXml(this.hdnChromedata.Value) is throwing error when hdnChromedata is a JSON string.
My question is, HOW can I make this JSON String to XML string?
OR is there any other to address this?
Basically I need a method to convert JSON string to XML string in ASP.NET 1.1