C# DLL from Javascript?

Is it possible to call a C# DLL from server-side Javascript Or would that be too much of a security issue

Thanks in advance,
Chris



Answer this question

C# DLL from Javascript?

  • dragoncells

    I think you may have inadvertently caused some confusion in your post, since people are equating this to mean "expose a UserControl in a Web Page".

    Your question asks if you can call a C# assembly from SERVER-SIDE Javascript. If you use JScript.Net, which is a full-fledged .NET - compliant language, you can have a reference to your C# assembly in your SERVER-SIDE code and make method calls on it. Is this actually what you meant

    Peter



  • Laxmikant_it

    Hi,

    It is possible but note that you need to have ActiveX enabled in your browser. This setting is mostly not set. So if you are planning to use .NET dlls, you need to make sure that ActiveX is enabled AND that the correct version of the .NET framework is installed on the client pc.

    Greetz,

    Geert

    Geert Verhoeven
    Consultant @ Ausy Belgium

    My Personal Blog



  • patriot074

    Great, I was afraid it wasnt possible. Happen to know any sites that would have examples/tutorials
  • Scott Chang

    Completely possible,

    You probably want to access properties of a .Net based windows control in Web Browser. Search google for IE Hosted Control etc. There is a lot of stuff on it.

    Note: Geert is right in his awnser that you'll have to play with IE's security setting (May be with .Net security too) to get your work done.

    I hope this will help.

    Best Regards,

    Rizwan aka RizwanSharp



  • Bryan Cooper

  • SarasMax

    Thanks for all the help.

    If I'm understanding correctly, I have to have ActiveX, the .NET framework, and browser security all setup/installed on the client for this to work. The problem I have with that is that my webpages are used by hundreds in an academic setting and I cannot guarantee that the clients will have all these. Is there any way to do this work server side and just return a value to the client - a string or bool or something

    Thanks,
    Chris

     


  • Eretria-chan

    This is possible. The DLL needs to be marked as COM visible though. It will then run in the security context of the browser.

    -Tom

  • GSus

    I dont think so Peter but I could be wrong. The application that I want to use the DLL is an asp webpage. It was written a while back with javascript as its client and server side language - I think it was originally done in visual interdev 6.0. We are trying to get the DLL to work to avoid having to re-write the app in C#.NET.

    Chris


  • C# DLL from Javascript?