G
Guest
Hi
I have a Xml Web Server control on my page
<asp:Xml id=Xml1 runat="server" EnableViewState="True"></asp:Xml>
I'm doing a transform as follows
System.Xml.XmlDocument doc = new System.Xml.XmlDocument()
doc.LoadXml(sXml)
XslTransform transform = new XslTransform()
transform.Load(Server.MapPath("./Xslt/DeloitteQuickLinks.xslt"))
Xml1.Document = doc
Xml1.Transform = transform
But on postback's the control doesn't maintain it's state and is blank after the post. If I do a transform directly to a label control as follows, it keeps it state between posts. Does this make sense?
...
System.IO.Stream stm = new MemoryStream()
transform.Transform(XmlDoc, xslArg, stm, new XmlUrlResolver())
stm.Position = 0
StreamReader sr = new StreamReader(stm)
string strStream = sr.ReadToEnd()
//Display transfrom
lblMenu.Text= strStream;
I have a Xml Web Server control on my page
<asp:Xml id=Xml1 runat="server" EnableViewState="True"></asp:Xml>
I'm doing a transform as follows
System.Xml.XmlDocument doc = new System.Xml.XmlDocument()
doc.LoadXml(sXml)
XslTransform transform = new XslTransform()
transform.Load(Server.MapPath("./Xslt/DeloitteQuickLinks.xslt"))
Xml1.Document = doc
Xml1.Transform = transform
But on postback's the control doesn't maintain it's state and is blank after the post. If I do a transform directly to a label control as follows, it keeps it state between posts. Does this make sense?
...
System.IO.Stream stm = new MemoryStream()
transform.Transform(XmlDoc, xslArg, stm, new XmlUrlResolver())
stm.Position = 0
StreamReader sr = new StreamReader(stm)
string strStream = sr.ReadToEnd()
//Display transfrom
lblMenu.Text= strStream;