I'm having trouble displaying a C # collection for classic ASP. I tried using IEnumerable and Array. but I get the error " object not a collection ".
my method is as follows:
public IEnumerable<MyObj> GetMyObj() { ... }
and on the side of classic ASP:
Dim obj, x Set obj = Server.CreateObject("Namespace.class") For Each x in obj.GetMyObj ...
So how can I transfer a collection to Classic ASP?
UPDATE:
maybe this is progress, the solution I found is to use a new class that inherits IEnumerable instead of using IEnumerable<MyObj> :
public class MyEnumerable : IEnumerable { private IEnumerable<MyObj> _myObj; . . . [DispId(-4)] public IEnumerator GetEnumerator() { _myObj.GetEnumerator(); } }
But now, when I try to access the MyObj property , I get the error message: Object required .
Any idea?
collections c # asp-classic com
Cd ..
source share