I have a page which is using a TreeView. The TreeView is placed within a user control for ease of code reuse. If the user control is loaded directly on to the page, by using a Register for the user control and then placing it on the page, then it works fine - the nodes are expandable.
In order to avoid having extra code on the page loading before it is necessary, I am attempting to move that user control off the page, and place it on a separate page. This new page is then invoked by doing an HTTP request against it, through a javascript call, and then writing the response into the area where it is to be placed.
However, when I do this, the TreeView changes to a postback instead of an expand. Further, the postback doesn't even do the correct action - it simply reloads the page instead of expanding the nodes.
A few things to note - in order to make this work, I needed to include the following two lines of code in the separate page that is being AJAX-called:
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) Return End Sub
and, in the Page properties, EnableEventValidation="false".
Does anyone have any idea why this would happen? I have tried many things to address it, but to no avail.