XmlDataSource.Data on PostBack loses it's value

Discussion in 'ASP .Net Web Controls' started by tMan, Aug 15, 2006.

  1. tMan

    tMan Guest

    i'm setting the Data property of an XmlDataSource on PageLoad to a xml string

    'on page load
    XmlDataSource1.Data = "<root>bla bla bla</root>"

    but when a PostBack occurs (say on a button click), the Data returns empty
    and GetXmlDocument errors with a NullReferenceException

    'on a button click event
    dim str as string = XmlDataSource1.Data 'this is empty

    i tried setting the EnableViewState to tru both on the control and page.

    is this XmlDataSource control behavior by design?
     
    tMan, Aug 15, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bruce W.1
    Replies:
    2
    Views:
    1,347
    \(Laurent Jordi\)
    Mar 7, 2004
  2. Roger R. Smith

    ASP.NET DropDownLost loses values on PostBack

    Roger R. Smith, Aug 18, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    524
    Roger R. Smith
    Aug 18, 2004
  3. =?Utf-8?B?QmVuamFtaW4gSm9sZGVyc21h?=

    LinkButton CommandArgument bound property loses value on postback

    =?Utf-8?B?QmVuamFtaW4gSm9sZGVyc21h?=, Aug 21, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    4,116
    =?Utf-8?B?QmVuamFtaW4gSm9sZGVyc21h?=
    Aug 21, 2004
  4. Dot Net Work
    Replies:
    2
    Views:
    689
    Dot Net Work
    Sep 20, 2006
  5. Joe
    Replies:
    2
    Views:
    510
Loading...

Share This Page