Home - Forums-.NET - FlyTreeView (ASP.NET) - Am I doing something wrong with the new 4.2 version?

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

Am I doing something wrong with the new 4.2 version?
Link Posted: 04-Apr-2007 11:09
The new 4.2 control gives me the following error:
WebForm_InitCallback is not defined
Page.TimerTopCats = null;
function GetTopCats()
{
  Page.TimerTopCats = self.setTimeout(\"GetTopCatsExec()\", 2000);
}

function GetTopCatsExec()
{
  Page.FTV = CFlyTreeView.getInstanceById(Page.FTVid);
  Page.FTVRootNode = Page.FTV.findByValue(\"DefaultRebate\")[0];
  try
  {
    Page.FTVRootNode.expand();
  }
  catch(e)
  {
    dbgMsg(\"Unexepected error:\" + e);
  }
  CloseTimer(Page.TimerTopCats);
}

I am using AjaxPro.dll on the same page, but this worked with the previous version.

I have installed the Microsoft ajax extensions on this computer. However, nothing else in the project uses the microsoft ajax.

I had to add the timeout to make this error even happen at all in Internet Explorer 7.0. Otherwise I get an error message that the page cannot be loaded.

GetTopCats is being setup on the serverside:
FTV.OnInitializedJavascript = \"GetTopCats()\";
Link Posted: 04-Apr-2007 11:58
Do you use Microsoft AJAX controls in the page with FlyTreeView?
Or do you use FlyTreeView within UpdatePanel or similar control?
Does the error occur after you perform any postback/partial reload of the page?

When calling
Page.FTVRootNode.expand();

Does this FTVRootNode load its child nodes on demand?

Also, please does the \"view source\" of generated page contains \"WebForm_InitCallback\" call?
Link Posted: 04-Apr-2007 12:02
And also, if possible, could you provide as simple as possible ASPX page, disconnected from your environment that we can run and debug here. But that still causes problems.

This is always the best way to solve any issues.
Link Posted: 04-Apr-2007 12:45
Please also try to add the following code as a possible workaround:

Page.ClientScript.GetCallbackEventReference(FTV, null, null, null);


Please add it at your Page_Load or OnPreRender server method.

Does this solve the problem?
Link Posted: 04-Apr-2007 13:05
The Flytreeview is in child page of a page that is also a child page of the master.

I added the code you posted just below the Page_Load:

protected void Page_Load(object sender, EventArgs e)
{
  Page.ClientScript.GetCallbackEventReference(FTV, null, null, null);


and it seems to fix the issue.
Link Posted: 04-Apr-2007 13:10
A new build with the fix is available for download.

You can leave it as you have, or download the latest version and remove the workaround.

Thank you for cooperation