Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have written an ActiveX component to get list of .Net frameworks installed on client's Machine.
When i use to test it with simple HTML page, it goes fine but when i run it in ASP.Net project then it says "Access is denied" while creating its object in javascript.

here is the javascript code, i am calling it on asp.net page body's onload

C#
function Onload() {
        debugger;
        // var obj = document.DemoActiveX;
        var obj = document.getElementById("DemoActiveX");
        alert(obj);
        //Returns: [object HTMLObjectElelment]
        if (obj != undefined && obj != null) {

            try {    //alert(obj.GetClientOS());
                alert(obj.GetClientOS());
            } catch (e) {
                alert(e);
                //Returns: Member not found
            }

        }
    }



Note: in stand alone HTML page it is running very fine.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900