Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / June 2005

Tip: Looking for answers? Try searching our database.

Calling .NET class from ASP

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vi - 20 Jun 2005 23:08 GMT
Hello,
I have a .NET class that I want to call from an ASP page. I did everything
they way it is described in
http://www.codeproject.com/dotnet/nettocom.asp?select=1005526&df=100&forumid=140
76&msg=1005526


Here's my ASP code:
<%@ Language=VBScript %>
<%
set obj=server.CreateObject("namespace.classname")
obj.mySubmit(Request)
%>

This code generates the error:  "Class doesn't support Automation" .
Note: the mySubmit class expects a HttpRequest as input parameter.

If I try to call  obj.OrderSubmit("123") (with a wrong input parameter), I
get the error: "Invalid procedure call or argument".

So I'm not really sure what is the problem. Is something wrong with the way
I'm registering the .NET class, or maybe the Request object from ASP is not
exactly the same as the HttpRequest object from ASP.NET, or maybe something
else?

Thank you in advance
Vi - 21 Jun 2005 00:08 GMT
I tried to create another simple method in the same class. It accespts an int
and returns the value of the int.ToString(). This methos works when accessed
from classic ASP.
So I guess the class is properly registered and the problem is the input
parameter which is Request ?? I'd appreciate any ideas about how to overcome
this problem.

Thans again.

> Hello,
> I have a .NET class that I want to call from an ASP page. I did everything
[quoted text clipped - 20 lines]
>
> Thank you in advance
Phil Wilson - 21 Jun 2005 00:47 GMT
Automation objects have a limited list of paramater types, and Request isn't
one of them by the look of it....

If the parameter doesn't map to a Variant, you can't pass it. There's a list
in here, scroll down, legacy types.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncomg/html/msd
n_vbscriptcom.asp

Signature

Phil Wilson [MVP Windows Installer]
----

>I tried to create another simple method in the same class. It accespts an
>int
[quoted text clipped - 37 lines]
>>
>> Thank you in advance
Vi - 21 Jun 2005 03:07 GMT
Thank you, Phil,
I was affraid that something like this will happend and it did :(.
I guess the same thing applies even if I would use server side JavaScript
instead of VBScript?

Thanks again.

> Automation objects have a limited list of paramater types, and Request isn't
> one of them by the look of it....
[quoted text clipped - 44 lines]
> >>
> >> Thank you in advance
Phil Wilson - 24 Jun 2005 21:55 GMT
That's true, the same general limitation.
Signature

Phil Wilson [MVP Windows Installer]
----

> Thank you, Phil,
> I was affraid that something like this will happend and it did :(.
[quoted text clipped - 58 lines]
>> >>
>> >> Thank you in advance

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.