Server.CreateObject Failed in Classic ASP

前端 未结 8 1060
抹茶落季
抹茶落季 2021-01-05 21:34

I created the ASP.NET dll with one function that i need to use in Classic ASP page.

I used the below code for creating object in classic asp page

set         


        
8条回答
  •  天命终不由人
    2021-01-05 22:11

    I faced a similar issue and after much research i found the solution ,check if its working for you. Remote scripting causes tons of errors with different IE versions. If your are passing control from one page to another and creating a new object from there you will get this kind of unable to create object error.

    Example:

    page x.asp--
    
    function1call() 
    function2call() 
    
    further in page x.asp--
    
    function1call(){
       var rs_obj = RSGetASPObject("some-object");
       ----some other things---
       frmPost.action = "someplace.asp"; 
       frmPost.submit();
    }  
    
    function2call(){
       var rs_obj = RSGetASPObject("some-object1"); //you wont be able to create 
                                                    //this object
       ----some other things---
    }
    

    It seems like the remoteScripting object is not getting initiated . As function1call() calls frmPost.submit().

    If you combine these 2 functions it will start to work. I.E

    page x.asp--
    
        function1call(){
           var rs_obj = RSGetASPObject("some-object");
           var rs_obj = RSGetASPObject("some-object1"); 
           ----some other things---
           frmPost.action = "someplace.asp"; 
           frmPost.submit();
    
        }
    

提交回复
热议问题