This is a discussion on com component in Javascript within the C# Programming forums, part of the Software Development category; Hi, I want create a dll file in C# and I would like to use it in Javascript code. Can ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi, I want create a dll file in C# and I would like to use it in Javascript code. Can any one tell me how to use it in Javascript?
__________________ The OXYGEN Delivers edgy, intelligent Technology to all... |
| Sponsored Links |
| |||
| Create a C# class Library. In a class file type the following: public calculate() { } public int add(int a, int b) { return a + b; } 1) Open project properties and add a key file then tick the Regster for com interop option ) build the library. 2) Open the command prompt of ASP.NET. 3) type gacutil /i dllName 4) type regasm dllName 5) Then open the notepad 6) type the following: <html> <head> <script type="text/javascript"> function fun() { var obj = new ActiveXObject("createActiveXcontrol.calculate"); //var obj = new ActiveXObject("createActiveXcontrol.dll"); alert(obj.add(6,5)); } </script> </head> <body onload="javascript:fun()"> </body> </html>
__________________ S.Balasubramanian Nothing is impossible |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Component for uploader | vims | PHP Programming | 1 | 10-13-2007 01:00 AM |
| How to set the TextArea component to Transparent | oxygen | Flash Actionscript Programming | 1 | 07-21-2007 02:47 AM |
| loading swf in accordion component | nssukumar | Flash Actionscript Programming | 2 | 03-20-2007 10:49 PM |
| accordion component | nssukumar | Flash Actionscript Programming | 0 | 03-08-2007 05:22 AM |
| accordion component | nssukumar | Flash Actionscript Programming | 0 | 03-07-2007 02:53 AM |