asked on
using System;
using System.Runtime.InteropServices;
namespace ClassLibrary1
{
public interface ASignatures
{
string FName();
string SName();
int Age { get;}
}
[ClassInterface(ClassInterfaceType.AutoDual)]
public class Class1 :ASignatures
{
public string FName()
{
return "Imran";
}
public string SName()
{
return "Nathani";
}
public int Age
{
get { return 24; }
}
}
}
<script type="javascript">
function NotifyActiveX(e)
{
if ( e.readyState != 4 ) return;
alert("ASD3");
var x = new ActiveXObject("ClassLibrary1.Class1");
alert(x.FName());
}
</script>
<OBJECT
id="LabelControl"
onReadyStateChange="NotifyActiveX(this)"
classid="CLSID:133DF296-A49B-4c97-8438-7BD07D5E631D"
codeBase="Cab1.CAB">
<b>ActiveX is not supported</b>
</OBJECT>