GoWebImage.axd problem when goview is used in ascx

I wrote a test flowchart program using goView object. It works fine when the View is called directly in a standard alone aspx. But when I use it in a ascx user control, javascript error happens in goWebImage.axd. The following are the content in goWebImage.axd:

goview_GoView1.Cursors = new Array(0,78,244,103,31,'',0,68,239,123,41,'pointer',0,108,94,44,31,'',0,98,89,64,41,'pointer',0,93,394,74,31,'',
0,83,389,94,41,'pointer'); goview_GoView1.ToolTips = new Array(); goview_GoView1.ToolTipDefault = ''; goview_GoView1.Menus = new Array();
.....
The problem is the goview object client ID is wrong in the gowebimage.axd. My user control file name is wfb_flowchart.ascx.
The correct client ID should be prefixed with the user control file name such as goview_wftFlowchart1_GoView1.
I believe the javascript functions in goWebImage.axd are generated in fly. Is there any way to set up the GoView in my ascx to make the .axd generate correct client ID for GoView?
Thanks.
Yes, that's right -- that should be JavaScript variable name.
When I define a UserControl such as:
[code] <%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %> <%@ Register Assembly="Northwoods.GoWeb" Namespace="Northwoods.GoWeb" TagPrefix="GoWeb" %> <goweb:goview id="GoView1" runat="server" bordercolor="Blue" borderwidth="2px" height="275px" width="416px" NoPost="True" ImagePage="GoWebImage.axd" ScriptFile="GoWeb.js" CssFile="none"></goweb:goview> <br /> <asp:Button ID="Button1" runat="server" Text="Add Stuff" Width="184px" OnClick="Button1_Click" />[/code]
and use it in an ASPX page:
[code]...
<%@ Register Src="WebUserControl.ascx" TagName="WebUserControl" TagPrefix="uc1" %>
...
<uc1:WebUserControl ID="WebUserControl1" runat="server" /> <br/> <uc1:WebUserControl ID="WebUserControl2" runat="server" />[/code]
I get HTML that includes:
[code]goview_WebUserControl1_GoView1.Cursors = new Array();
goview_WebUserControl2_GoView1.Cursors = new Array();[/code]
Everything works fine -- no errors.
So I don't understand how your situation is different from what I would expect is a normal definition and use of a UserControl that includes a GoView in it.

If I do View Source and open the HTML, I got the correct Client ID too such as:

goview_wftFlowchart1_GoView1.Cursors = new Array(0,67,244,66,31,'',0,57,239,86,41,'pointer',0,78,94,44,31,'',0,68,89,64,41,'pointer',0,63,394,74,31,'',
0,53,389,94,41,'pointer');
But there is still error when the GoView is clicked and the error is from GoWebImage.axd, not from the HTML.
I believe the .axd is called when loading image function fires off. If I turn on the IE7 debugger, VS2005 point me to the .axd.
Can you have a look at the .axd? Thanks.

OK, when I look at the JavaScript returned by GoWebImageHandler.FindSessionViewData, which is written to HttpContext.Response.OutputStream, it looks just as we both expect – with the qualified name including the user control ID.

Again, I would like to know more about your configuration to see how it might be different from mine.

This is my aspx:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="wfb_flowchart_test.aspx.vb" Inherits="iq.wfb_flowchart_test" %> <%@ Register TagPrefix="uc1" TagName="wftFlowchart" Src="wfb_flowchart_UC.ascx" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <uc1:wftFlowchart id="wftFlowchart1" runat=server></uc1:wftFlowchart> </form> </body> </html>

This is my ascx:(wfb_flowchart_UC.ascx)

<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="wfb_flowchart_UC.ascx.vb" Inherits="iq.wfb_flowchart_UC" %> <%@ Register TagPrefix="goweb" Namespace="Northwoods.GoWeb" Assembly="Northwoods.GoWeb" %> <goweb:goview id="GoView1" runat="server" bordercolor="Blue" borderwidth="2px" height="275px" width="416px" NoPost="True" ImagePage="GoWebImage.axd" ScriptFile="GoWeb.js" CssFile="none"></goweb:goview>
I turned on IE7 debugger. Once I single click the View, the javascript error happens. It is from GoWebImage.axd.
Could you have a look please? Thanks.

I got it! The error only happens when sessionState is “StateServer”. Everything works fine if sessionState is “InProc”.

Is there any solution for "StateServer"?

You have to make sure everything is serializable. There are a number of topics in this forum where that has been the factor causing things to fail.

But as you can see, my 2 test pages are extremely simple. Can you give me any suggestion that how to make this simple example work in “stateServer” mode? In my sample, what shall I do to make everything serializable? Thanks a lot.

Make sure all your classes are marked [Serializable] or <Serializable()>.

Make sure all your fields are serializable.
For those classes that inherit from classes that implement ISerializable, make sure you implement a serialization constructor as well as GetObjectData.

Since my sample is very simple, I added <Serializable()> before the class name in both of the code behind files. Still, the javascript happens when the view is clicked. In this sample, I did not use any of my class. It is just a GoView class.

Could you please try my sample in VS2005 and set the sessionState value to "StateServer"? If you can make it work, please let me know how. If you get error too, could this be a bug of the GoView Class? Thank you.

Here’s what I tried, again, just now: http://www.nwoods.com/forum/uploads/WebSite2.zip

I am looking at it. Thanks a lot.