Postback & Xml Control ViewState

  • Thread starter Thread starter BluDog
  • Start date Start date
B

BluDog

Hi

I have an Xml control that reflects a tree structure from a serialized
object that is generated in the Page_Load event:

If Not IsPostBack Then

Dim ms As New IO.MemoryStream
Dim ser As New
System.Xml.Serialization.XmlSerializer(Content.Site.GetType)
ser.Serialize(ms, Content.Site)
Xml1.DocumentContent =
System.Text.UTF8Encoding.UTF8.GetString(ms.ToArray)

End If

The transform source is static and therefore set at design time. The
problem i have is that when the postback occurs the Xml control does
not maintain it's transformed document. I cannot perform the transform
when there is a postback because the tree structure is reset.

Any ideas would be greatly appreciated.

Thanks

Blu
 
BluDog wrote:

I have an Xml control that reflects a tree structure from a serialized
object that is generated in the Page_Load event:

If Not IsPostBack Then

Dim ms As New IO.MemoryStream
Dim ser As New
System.Xml.Serialization.XmlSerializer(Content.Site.GetType)
ser.Serialize(ms, Content.Site)

Try setting
Xml1.EnableViewState = True
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top