Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

calling a C# function from asp page

I wrote a small function in C# that manipulates pdf files using itextsharp. Is it possible to call this function from a classic asp page?

-Vivek

like image 847
Vivek Chandraprakash Avatar asked Nov 15 '22 09:11

Vivek Chandraprakash


2 Answers

Yes.

You can either expose your C# class via COM to the Classic ASP page or create a .NET Web Service that you can call from the Classic ASP page.

Personally, I would suggest exposing your C# class via COM (follow the "Exposing C# to COM" section).

like image 156
Justin Niessner Avatar answered Nov 30 '22 23:11

Justin Niessner


Yes, if you register the C# assembly as a COM+ component (using regsvcs.exe). You can then do this:

Set myObject = Server.CreateObject("mynamespace.myobject.myclass")
myObject.MyMethod()
like image 40
Sandor Drieënhuizen Avatar answered Nov 30 '22 23:11

Sandor Drieënhuizen