Click here to Skip to main content
15,905,963 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am building an app for desktop sharing using asp. In which I am using RDPViewer in .net.
My problem is I have build a Javascript function shown below:

JavaScript
function BtnConnect1()
{
    var e1 = document.getElementById('Client');
    var e2 = document.getElementById('Text1');
    e1.Connect(e2.value,"User1","");


}
function BtnDisConnect1()
 {
    var e1 = document.getElementById('Client');
    e1.Disconnect();

}

this code in body:
XML
<object id='Client'  runat="server" lang='javascript' classid="CLSID:32be5ed2-5c86-480f-a914-0ff8885a1b3f" style="width: 1239px; height: 639px"></object> 
 <input id="Text1"  runat="server" type="text" style="width:1052px"/>

at design-time connect() is showing in intellisense but at runtime the following lines gives error :
e1.Connect(e2.value,"User1","");

error:
"Message: Object doesn't support this property or method"

I am not getting clue why it is coming!! please suggest something !!its urgent!!!
Posted
Updated 16-Mar-11 23:28pm
v2

1 solution

C#
var e1 = document.getElementById('Client');
            var e2 = document.getElementById('Text1');
            e1.Connect(e2.value,"User1","");

Firstly, e1 is just a variable which holds a object value here that will be defined at runtime. So, I have no idea how come you can get intellisense for Connect() associated with it.

Now, based on error, clearly the connect() method is not exposed of the object you are trying to use.
Use Javascript debugging to see the internals and confirm if the method is exposed.
Put a debugger; at the start of function and enable Javascript debugging in your IE settings. Once done, it would automatically stop there in debug mode where you can see whats there in the e1 object. May be it's null and document.getElementById('Client'); needs a change to get the required object correctly.
 
Share this answer
 
Comments
saloni15 17-Mar-11 6:10am    
i debugged my app with debugger as you suggested and the var e1 is not null ,its getting 'client' clsid,id and other detials also. Is there some problem with clsid of rdpsession cz its picking up audio tool clsid?

yeh i was wondering same about intellisence can't say about it coz its still showing that method :)
Sandeep Mewara 17-Mar-11 7:19am    
problem with clsid of rdpsession cz its picking up audio tool clsid?
surely looks like an issue as it's not picking the one you want. Right?

yeh i was wondering same about intellisence can't say about it coz its still showing that method
Ok. :)
Espen Harlinn 18-Mar-11 5:02am    
Nice reply, my 5

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