views:

296

answers:

1

I have a problem with a Windows Forms control wrapped up in a DLL and deployed to IE within an Object tag. The object should return a string which Javascript puts into a hidden field ready for posting back to the server. This is an approach I have used several times, but I am now getting the dreaded "Object does not support this method or property" error message from Javascript. I've narrowed this down to the call to the function which returns a string.

Things I've eliminated:

  1. Spelling mistakes on the function call
  2. The called function is a public function
  3. Permission errors - all running on localhost, trusted Sites, etc

Things that may be relevant:

  1. The dll contains a couple of classes which are used in the Control
  2. The Control is custom, but uses various windows forms controls
  3. The basic flow is that the control (which allows users to enter multiple pages of drawings) builds an object, which is serialised and outputted to a base 64 string. The javascript calls an output function and places the (compressed) string into a hidden control. The form is submitted and the string is posted back to the server for processing.

If anyone could help, I would appreciate it.

<body>
<script language="javascript" type="text/javascript">
    function GetValues(){
        alert(document.draw1.ReturnSerialisedObjectString());
        return true;
    }
</script>


<input type="hidden" id="hdnData" runat="server" />
<input type="button" onclick="javascript:return GetValues();" value="Click Me" />

<br /><br />

<object id="draw1" classid="SlainteCustomControls.dll#SlainteCustomControls.FreeFormControl" width="482" height="579" viewastext />

A: 

Try:-

alert(document.getElementById('draw1').ReturnSerialisedObjectString());
AnthonyWJones
Already have, no joy with this either.Could there be something else at a machine level stopping the User Control from being accessible via JavaScript? I've already modified CAS policies to allow full permissions for localhost (for testing).
StickyMcGinty