AJAX issues

It was my understanding that version 2.6.2 is AJAX-aware. I am using 2.6.2 and, if I put a user control containing a GoView into an UpdatePanel in ASP.NET, it does seem to work (with some drawing issues that I should be able to resolve). But, if I try to CREATE the GoView dynamically, so that sometimes there is a GoView in the panel, and sometimes there isn’t, then I get errors (an html rendering error and a javascript “Object Expected” error).



Am I correct in my understanding that 2.6.2 supports AJAX functionality? If that is the case, then I assume my design or implementation is wrong, and that is why I am getting the error.



I downloaded the eval version of 3.0.3 but I thought I should clarify this before I go to the trouble of switching to that version. Because, if the problem is in my implementation, then upgrading my version won’t solve anything.



Thanks very much for whatever advice you can give.

2.6.2 had some changes to make GoDiagram “AJAX aware” and work with UpdatePanel. Is the javascript error from goweb.js?

3.0.3 did have some minor changes to goweb.js, but I don’t think they were AJAX related. Still, it never hurts to run the latest version.

Thank you for your response.

I have been playing with this today (between interuptions) in an effort to get a little more clarity on the error.
I have simplified the page as much as I can. I basically have an ASP page that has a button on it, and a user control that I wrote which is contained in an UpdatePanel control.
Here is my code for that page:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="explore.aspx.cs" Inherits="explore" %>
<%@ Register Src="~/element.ascx" TagName="element" TagPrefix="elmnt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
http://www.w3.org/1999/xhtml" >

Explore























The user control "ctrlElmnt" will, when certain conditions are met, add a user control called chartOrg.ascx to its Controls collection. The chartOrg.ascx control is a wrapper I wrote for GoView.
I don't get any errors if I don't have the update panel in the page. I have been dynamically adding (or not adding) the GoView to the page for about a year or more, using a full post back, with no errors. But, now, when I put it in the update panel, I get "Microsoft JScript runtime error: Object expected".
I only get this error when using IE. I am using version 7.
I do not get it with Firefox. I do not get the error if I replace the chartOrg.ascx with some other, standard, control, like a Label or Button.
The error seems to be caused by the fact that eventTarget is null when passed to the __doPostBack Javascript function generated by ASP.NET.
Have any other users experienced this problem?
I would really appreciate any suggestions you have for solutions, or even further debugging of the problem.
Thanks very much
Has anyone else reported problems such as this?

Do you have the GoView as NoPost = true?

With Visual Studio and IE, you should be able to set breakpoints inside our goweb.js to see if it’s the __doPostBack there.

Thank you for your response.
I did have NoPost=“true” but, changing it to “false” has no effect. I get the same error.
The error happens before my breakpoints in GoWeb.js are encountered. (I do not see a __doPostBack() function defined in GoWeb.js but, I put break points at the two calls to __doPostBack() that are listed – in the GoPost() function, and those breakpoints were not encountered)
From what I understand, the debugger in VS is a little unreliable when it highlights source in the web page. But, with that being said, the lines that are highlighted in VS when the “Object expected” error is thrown are these:





I believe these are the lines that are created by the ScriptManager control in ASP.NET.
[One oddity that I noticed - When the debugger throws the error, and I "break" the processing, if I hold my cursor over the words "name" or "id" on ANY of the lines listed above, the tooltip that pops up reads "GoView1". I am not sure if that is just weird behavior in the debugger or, if it has meaning] I thought that, possibly, I would need to pass the ASP-created ClientID of my GoView up to the parent page, and somehow get that into the __doPostBack function. But, I think I have proven that that is not the issue. Here is how: For testing, I created a user control (test.ascx) that is a simple wrapper for a standard label control:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="test.ascx.cs" Inherits="test" %>
In my other (ctrlElmnt) control, that dynamically creates the GoView wrapper control, I replaced the GoVew code with code that dynamically creates this new user control (test.ascx), with the standard label in it. So, I am creating this simple control instead of creating the GoVeiw control...and I am doing it in the same manner that I create the GoView (one user control creating another, which in turn creates the final control--GoView\Standard Label). So, when I click the button on the test page, the label is created with no errors. It would seem that, if ClientID were the issue, it would also be an issue for this simple label, since it is created in the same manner as GoView. So, I am completely stumped. There must be something fundamentally wrong with the way I am trying to use GoView. I am sure the solution, once I find it, will be embarassingly obvious and simple but in the mean time, I have been completely stymied for a week now. I may just need to re-think my design, and start over. I can always revert back to using full page postbacks. Thanks

GoView NoPost=“True” is the desired value. However, only in version 3 is that the default value, so you should be sure to set it to true whenever you create a GoView.

__doPostBack is defined by ASP.NET to perform a post back. You should see it in the rendered HTML file.

Are you saying that the error happens only in a call to __doPostBack? As you can see in the definition of goPost in GoWeb.js, __doPostBack is never called as long as NoPost=“True”. (That server GoView property is mirrored as the client element’s goNoPost property in JavaScript.) And you have confirmed this by your breakpoints at the two calls to __doPostBack that a GoView might make.

So __doPostBack is being called by some other code as part of the (partial) post back mechanism used by other controls, including your user controls. Can you debug this to find out what is making the call that causes the error?

Thanks for your continued response.

Yes, I see the __doPostBack defined in the rendered HTML file, I misunderstood Jake's previous post and thought that he meant there was a __doPostBack defined in GoWeb.js.
It doesn't appear that the error is happening in the __doPostBack function.
In my simple example, with only a button and the user control that creates the GoView (via the second user control), when I click the button, the Page_Load events for the parent page, the ctrlElmnt user control, and the GoView wrapper control (called chartOrg.ascx) all run without error. The error happens after that, when the page is being rendered.
As I said before, the yellow highlighting in the debugger, when execution is halted by the error, is on this code:


But, I am not sure how trustworthy this error highlighting is, in this context. I am not familiar with any techniques to debug the page rendering.
Also, as I stated in one of my first posts, I do not get the error in Firefox. I only get it in IE which, unfortunately, is what my client uses exclusively.
If you can make any suggestions that will help me identify what I have done wrong, I would appreciate it but, I also understand that it isn't your job to spend your daying solving my problems. I am the only developer on this project (the only developer in our company, actually) so, I don't have anyone to help analyze my code and identifiy mistakes. Unfortunately, I have to rely on forums such as this when I get stumped.
Any pointers would be greatly appreciated, though.
Thanks.

Is there any way for you to send us a minimal example of this, not using any of your application-specific code or data? It would be helpful if we could understand and reproduce the problem.

Yes.

Thanks very much for your offer of help.
I have created an abbreviated version of my application already but, I will need to abbreviate it even further before I send it. I am still relying on real data (via a webservice, database, etc) to create the GoView.
I will try to get some code from one of the GoDiagram samples that will create a GoView from static data, and insert it into my testing example. Then I can see if there is still a problem, and then send you the abbreviated code. I will send that later this afternoon.
Again...many, many thanks.