AJAX Update Panel and GOView

I have been experimenting with the new AJAX extensions that have been released for ASP.NET. There is a component called “UpdatePanel” in which anything added inside it can be updated without a postback, much like the GoView NoPost feature.

The problem occurs when I add a GoView within a View within a MultiView within the UpdatePanel. When I load the page and click a button to show the View that contains GoView, I get a javascript error stating that “goview_WorkView” is undefined. “WorkView” is what I have set the GoView ID to. For some reason “goview_” is inserted in front of the ID. All GoView controls still work properly, such as adding nodes, removing them, double clicking, etc… The only thing that does not work is the context menu.

Any reason as to why “goview_” is added to the GoView ID? This only happens if the MultiView is inside the UpdatePanel. This error does not occur if GoView by itself is placed within an UpdatePanel.

That's the name of the JavaScript variable that holds the object representing information about the GoView. That includes tooltips, cursors, GoPartInfos, default click behaviors, and context menus. It gets initialized by script that is rendered along with the tag.
So view the (HTML) source for the page, and see if there's JavaScript defining and initializing that goview_WorkView variable.
By the way, you do have GoView.NoPost set to true, right? If you don't (or if you set the goNoPost property of the IMG element to false on the client side), then client-side context menus won't work.

Yes, I have GoView.NoPost set to true. It may be because there is a javascript error, the page flashes whenever I click on the GoView so the context menu won’t show.

I viewed the HTML source and can’t find anywhere that initializes ‘goview_WorkView’.

If you use a GoView within a MultiView, with no UpdatePanel, does everything work? I know this combination should work. There should be the initialization of goview_WorkView in in the HTML source.

Maybe MultiView works differently inside an UpdatePanel.

Yes it works if not in an UpdatePanel.

I compared the HTML source between when the multiview is in the UpdatePanel and not in the UpdatePanel. When NOT in the UpdatePanel, it works like you mentioned and the javascript initialization of goview_WorkView shows:

var goview_WorkView = new Object();
goview_WorkView.Cursors = new Array();
goview_WorkView.ToolTips = new Array();
goview_WorkView.ToolTipDefault = ‘’;
goview_WorkView.Menus = new Array();
go_=goview_WorkView.MenuDefs = new Array();
go_[0]=new Array(’’,new Array(‘Select All’,3,‘goAction(‘selectall’,‘WorkView’)’),new Array(‘Add Node’,3,‘AddNode()’),new Array(‘Remove Node’,3,‘RmvNode()’));
goview_WorkView.MenuDefault = ‘0’;
goview_WorkView.Infos = new Array();
go_=goview_WorkView.InfoDefs = new Array();
goview_WorkView.NoClick = null;
goview_WorkView.SingleClickDefault = null;
goview_WorkView.DoubleClickDefault = null;
goview_WorkView.ContextClickDefault = null;

When the multiview is in the UpdatePanel the above javascript is not in the HTML source.

GoView doesn’t render any differently depending on whether there’s an UpdatePanel containing it, since it doesn’t even know about them. We’ll investigate.

Sounds good, thanks for your help.

Could you send us e-mail? Your profile doesn’t include an e-mail address.

I put my email in my profile.