XML control not maintaining contents after postback, even with EnableViewState=true

  • Thread starter Justin Crossley
  • Start date
J

Justin Crossley

I have a webform that lists search results using an XML control

The search results are contained in a string called strResults and are transformed using an xsl file into formatted results.

The c# code is as follows:

XslTransform trans2 = new XslTransform();
trans2.Load(Server.MapPath("HitList.xsl"));
xmlSearchResults.DocumentContent = strResults;
xmlSearchResults.Transform = trans2;

This works fine, but I want to be able to do a postback whilst maintaining the search results using viewstate.

If I enable viewstate the xml control is empty after the postback.

Other controls on the form successfuly return their viewstate so everything else appears to be working.

Any ideas anybody?

Thanks

Justin Crossley
 

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

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top