IT Community - Software Programming, Web Development and Technical Support

com component in Javascript

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 ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 12-18-2007, 11:36 PM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default com component in Javascript

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...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-18-2007, 11:39 PM
Balasubramanian.S Balasubramanian.S is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 182
Balasubramanian.S is on a distinguished road
Default Re: com component in Javascript

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
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -7. The time now is 09:05 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0