By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,686 Members | 1,109 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,686 IT Pros & Developers. It's quick & easy.

Xml Web Server control doesn't maintain state?

P: n/a

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()
XslTransform transform = new XslTransform()
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;
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a

Yes XML control doesn't override IstateManager.LoadViewState. Therefore
XML isn't loading it own state from __ViewState. XML derived from
Control. Control implementation of LoadViewState just load control
visible attribute.

Label override LoadViewState therefore maintains state. Textbox dosen't
need to maintain state INPUT values are automatically sent via Form on
any request.


Natty Gur[MVP]

blog :
Mobile: +972-(0)52-8888377
*** Sent via Devdex ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2

P: n/a

Do you know of any MS documentation that describes this behavior? Thanks again. Dave.
Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.