Link to home
Start Free TrialLog in
Avatar of ANDREW GNANAM
ANDREW GNANAM

asked on

Embedding C# Dll into object to execute from jquery.

I have implemented the solution to call the c# function at the client side by doing the embed of the c# dll in <object>

It was working fine. But, gives run time error while trying to access from the new system.

The object call is: window.<Object Name Defined in the html script>.<Funtion / Method Name in the .dll>

Getting the following error;

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method

The implementation done initially in VS2010 and later upgrated to VS2015.


Thanks in advance.
Avatar of ste5an
ste5an
Flag of Germany image

D'oh?!

Can you rephrase your question and provide more context? What kind of project? Why a DLL? Why embedding by using the <object> tag?
Avatar of ANDREW GNANAM
ANDREW GNANAM

ASKER

Hi,

1. I have solution
2. the solution multiple projects (more windows dll)
3. One project (windows application) has a method to get the location from the file upload control. The method name is GetSelectedFolderPath(). The function would return the selected folder path by the end user
4. There is a web site in the solution.
5. In one of the forms in the web site, the dll (used to get the selected folder path) is embedded in <object>
6. The method name GetSelectedFolderPath( ) is invoked in the form.js (this is the jquery file has all the related functionality of the asp.net form).

The application throws the run-time error in the .js file as the below when the website invokes the method GetSelectedFolderPath( ) from the javascript.

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method <The Method Name i.e GetSelectedFolderPath( )>

Let me know, if any more details required.

Thanks in advance.
There is a good reason for browsers not to provide the path information: Security.

Why do you need that information?
It is not the browser not to provide the path information. But, the function itself is not accessible, even, the scope of the function has been changed to add two numbers.

NOTE: It was working fine in lower environment i.e. VS 2010 as stated in my initial description and stopped working only after upgrading the source to VS 2015. Nothing more is added or removed.
Check your original project settings with the current ones (target platform, bitness etc.) Also check assembly.cs. I assume you created a COM+ compatible DLL. in this case check also the registration (regsvr). Also do you run the assembly from GAC or from a local folder?
I am running the dll from local folder not from the GAC.
Did you register it successfully? Can you instantiate it e.g. in VBScript?
Some more details added to the previous:

The dll is in the framework 3.5 and it is a com visible assembly
The web is in the framework 4.0

I am not able to register the dll using regsvr32 because, it requires the startup object.

The running dll is in local folder not in GAC.
.Net assemblies have to be registered with regasm, not regsvr32.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.