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:
- Spelling mistakes on the function call
- The called function is a public function
- Permission errors - all running on localhost, trusted Sites, etc
Things that may be relevant:
- The dll contains a couple of classes which are used in the Control
- The Control is custom, but uses various windows forms controls
- 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 />