Hi,
I am having real troubles subclassing GoWebImage and GoView.
I have a GoView which seems to be subclassed successfully and simply produces some Javascript.
We also have a GoWebImage Subclass which our drawing page uses as the GoDiagram.aspx. We have successfully inherited the GoWebImage and it does get called when the page is loaded.
I have noticed two issues.
- The session state never seems to be stored, so when the Subclassed GoView Control is called using findSessionViews always returns null.
protected override void OnLoad(EventArgs evt)
{
GoView saved = FindSessionView();
if (saved != null)
{
LoadView(saved);
}
else
{
CreateView();
OnSessionStarted(EventArgs.Empty);
}
base.OnLoad(evt);
// produce helper JavaScript function definitions
RenderScript();
// produce __doPostBack definition
// Form the script that is to be registered at client side.
String scriptString = " function OutputSize() {\n";
scriptString += “var width=document.getElementById(“MCLContainer”).offsetWidth; \n” ;
scriptString +=“var height=document.getElementById(“MCLContainer”).offsetWidth * 3/4;\n”;
scriptString +=“var innerstring = document.getElementById(“MCLContainer”).innerHTML;\n”;
scriptString +=“innerstring=”<IMG SRC=\“MCLView.aspx?MCLGoView=Viewer1&width=”+ width +"&height="+height+ “\” name=\“Viewer1\” width=\"" + width + “\” height=\""+height+ “\”>";\n";
scriptString +=“var innerstring = document.getElementById(“MCLContainer”).innerHTML=innerstr ing;}<”;
scriptString += “/”;
scriptString += “script>”;
if(!this.Page.IsClientScriptBlockRegistered(“clientScript”))this.Page.RegisterClientScriptBlock(“clientScript”, scriptString);
this.Page.GetPostBackEventReference(this);
}
Why would it always return null? I have implemented OnInit on the GoView and OnLoad on the GoView as per the UserGuide. The second point to note (and I think this is where the problem is comming in) is that if we simply use the Normal GoWebImage as the page we are using as the image, the image was displayed fine (It is not working now). It is when we create a SubClass of GoWebImage we run into problems. Are there any examples of subclassing GoWebImage? If there it would be a massive help to me, as we have this important task we have to complete ASAP.
Regards,
Paul