I currently have an dll created in .Net 2.0 that has a COM visible component that is used as an ActiveX object on a webpage within IE.
The concept works fine, calling function, raising events, passing variables back and forth. The problem comes with complex classes of information.
For example, I have this class:
public class ClientInfo {
public ClientInfo() { }
public ClientInfo(DataRow dr)
{
ClientName = dr["Name"].ToString();
Address = dr["Address1"].ToString();
}
public string ClientName;
public string Address;
}
Which is simple enough. I then have a function that builds an array to be returned that is made of the aforementioned class:
ArrayList arr = new ArrayList();
foreach (DataRow r in dsClients.Tables[0].Rows)
{
arr.Add(new ClientInfo(r));
}
return arr.ToArray();
From javascript when this function is called, the return is undefined. It works fine when called from another .Net project (that consists of a simple button to test this very issue).
It seems I somehow need to convert the return object to something more accessible via javascript (JSON?), or possibly define the type of return variable within javascript.
Any help would be appreciated.
EDIT: Of course, I can't use serialization because that isn't included until .Net 3.5, and our target is 2.0