473,406 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

using C# dll methods in asp

AnuSumesh
Hi All,

I have one dll written in c#. One of its methods return array of dictionary.
I want to call and use that method in ASP file.
I am using jscript in ASP.

my code is a s follows:
Expand|Select|Wrap|Line Numbers
  1. <%
  2. var cls;
  3. cls=new ActiveXObject("shareaccessanu.FileOperations");
  4. var collection=cls.getdic();
  5. Response.write("type of  collection "+typeof(collection));
  6. %>
  7.  
the output is "unknown" i.i typeof returns unknown

How can i use this?

The dll name is shareaccessanu and it contains 3 different classes named Fileoperations, Share. Sharecollection.
One of method of class Fileoperations returns array of class Share.
How to use all these methods in Jscript.

Plzzzz help me in above issues.
I ll be fired if i will not complete the project.
Its very urgent.

Thanks,
Anu
Nov 19 '08 #1
9 6999
jhardman
3,406 Expert 2GB
I know this isn't what you wanted to hear, but my suggestion is abandon asp, do this whole thing in .NET - then referencing an outside .dll is built-in.

Jared
Nov 20 '08 #2
I can't avoid ASP.
My company already have some project which is using dll.
I have to replca ethat dll with my dll which should support all exisitng dll functions.
Even i dont know the functionality of some of existing dll functions

Plzzzzz help

Anu
Nov 21 '08 #3
Hi All,

I have created one dll in c# and using that dll in ASP programs. All dll methods are working fine ion ASP except one method that returns dictionary object.
When i am calling that method in asp (using jscript), its giving error "object unknown".

My asp code is as follows:

Expand|Select|Wrap|Line Numbers
  1. var cls=new ActiveXObject("shareaccessanu.FileOperations"); 
  2. //shareaccessanu is dll name
  3. var item=cls.UsrBrowseContent("D:\\Anu"); //method returns dictionary object
  4. Response.write("typeof= "+typeof(item)); //return "unknown"
  5.  
Can anyone please help me how can I use this method in ASP?
Plzzzzzzzz its urgent.

Thanks,
ANU
Dec 2 '08 #4
jhardman
3,406 Expert 2GB
Anu,

1- Please don't double-post your questions. I have merged threads this time, but consider this a warning. Double posting is strictly prohibited by the Bytes site guidelines. Asking an expert to weigh in on a particular question that has gone unanswered is permitted.

2- Please write your words out. When I see "plzzzzz" in a post my first response is "this poster is so lazy he can't even be bothered to write out 'please'. Why should I help someone that lazy?" This is a common gripe among forum mods and experts, we will all be similarly annoyed by your posts.

3- I don't think any of us do what you are trying to do, the number of people who write asp is small enough, the number who write asp in javascript is a small fraction of that, and the number who include custom dlls in a classic asp page is staggeringly low. Nevertheless, from your last post, I see that the error given says the object is unrecognized. Which line is giving this error? The new object line or the UsrBrowseContent line?

Jared
Dec 3 '08 #5
CroCrew
564 Expert 512MB
Hello AnuSumesh,

Let’s see if we can figure this one out. Please post the code you’re using to call this method too. That might help out with finding a solution.

CroCrew~
Dec 4 '08 #6
Hi
Thanks for considering my problem.

DLL method code is as follows:

Expand|Select|Wrap|Line Numbers
  1. public Dictionary<string, string> AdmEnumerateDomains()
  2.         {
  3.             Dictionary<string, string> dic = new Dictionary<string, string>();
  4.             dic.Add("anu", "female");
  5.             return dic;
  6.         }
  7.  
ASP code(using jscript)
Expand|Select|Wrap|Line Numbers
  1. //dll is shareaccessanu and class name is FileOperations
  2. var cls;
  3. cls=new ActiveXObject("shareaccessanu.FileOperations"); 
  4.  
  5. var collection=cls.AdmEnumerateDomains();
  6. Response.write("type of "+typeof(collection)); // result is "unknown"
  7.  
Thanks
Anu
Dec 4 '08 #7
CroCrew
564 Expert 512MB
Hello AnuSumesh,

With the help of a good friend of mine (thanks Mike!) I came up with this:

I ' m not sure what you're trying to get out of the typeof() operator.... it looks like it will only return six possible values: The typeof operator returns type information as a string. There are six possible values that typeof returns: "number," "string," "boolean," "object," "function," and "undefined."

It seems, and I've not tested this so I may be wrong, that since you've already returned the method and cast it as a var, it wouldn't really know what type of object it is....

Can you do something like this? typeof(cls.AdmEnumerateDomains())?

I would guess that doing that would return object, but I ' m not sure how helpful that is to you.

Sorry I can't be more helpful. Kind of a goofy setup (C# dll being used by Jscript via a Classic ASP page).
Dec 4 '08 #8
Thanks a lot.

I have tried your option also but its also giving output "UNKNOWN".

Actually i want to call this method(returns dictionaryobject) in asp page.

Thanks,
Anu
Dec 5 '08 #9
CroCrew
564 Expert 512MB
Hello AnuSumesh,

Sorry I can't be more helpful in solving your problem. Like I said kind of a quirky setup you got there.

Hope you find a solution top your problem,
CroCrew~
Dec 5 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Michael Sparks | last post by:
Anyway... At Europython Guido discussed with everyone the outstanding issue with decorators and there was a clear majority in favour of having them, which was good. From where I was sitting it...
5
by: Andrew | last post by:
I want to use a managed c++ class from an unmanaged class. Here is my code: // *** Unmanaged Code // .h file class UnmanagedClass { public: // Other stuff here
6
by: ransoma22 | last post by:
I developing an application that receive SMS from a connected GSM handphone, e.g Siemens M55, Nokia 6230,etc through the data cable. The application(VB.NET) will receive the SMS automatically,...
5
by: chandu | last post by:
can any one give advantages and disadvantages to using static methods in a class. shall we use complete static methods in a class ? thanks
4
by: a_agaga | last post by:
Hi! Do you know different alternatives to convert exceptions in many methods of some wrapper classes. User -Wrapper classes -LibraryClasses -... Wrapper classes catch an exception of only...
6
by: semkaa | last post by:
Can you explain why using ref keyword for passing parameters works slower that passing parameters by values itself. I wrote 2 examples to test it: //using ref static void Main(string args) {...
6
by: burningodzilla | last post by:
Hi all - I'm preparing to dive in to more complex application development using javascript, and among other things, I'm having a hard time wrapping my head around an issues regarding "inheritance"...
7
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I access a property of an object using a string?...
61
by: Sanders Kaufman | last post by:
I'm wondering if I'm doing this right, as far as using another class object as a PHP class property. class my_baseclass { var $Database; var $ErrorMessage; var $TableName; var $RecordSet;...
83
by: liketofindoutwhy | last post by:
I am learning more and more Prototype and Script.aculo.us and got the Bungee book... and wonder if I should get some books on jQuery (jQuery in Action, and Learning jQuery) and start learning about...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.