Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to access .net component from asp page

Status
Not open for further replies.

jrenae

Programmer
Jan 18, 2006
142
US
Hello,

I've created a component in .NET which I want to call from an asp page. I registered it using regasm into the same directory as my virtual folder. However, I do not have access to the methods. I'm confused about the app name, project name and namespace.

Application name (in assembly info) = myappname
project name (dll) = myproject.dll
namespace = MYNAMESPACE
class name = myclass

what is the correct format in server.createobject

Server.CreateObject("myappname.MYNAMESPACE.myclass")
Server.CreateObject("myappname.MYNAMESPACE.myproject.myclass")
Server.CreateObject("myappname.myproject.MYNAMESPACE.myclass")

can someone please help me out?

also, I don't need to put in component services or register it usign regsrv32 do I since I used regasm?

Thank you very much

 
jrenae,

Hopefully this will help.

I make a Project named "MyProj1"

I compile it as "XProj.DLL"

Inside the project "MyProj1", I have a class module called
MPClass1

Inside the class I have 2 sub's
Sub1 & Sub2

I register the dll as regsvr32 "C:\Xproj.dll"
I create the object in the asp page and point it towards the sub I want to use as:

Dim MyObj

set MyObj = server.CreateObject("MyProj1.Sub1")

If I want to use Sub2 I Create another object
server.CreateObject("MyProj1.Sub2")

I haven't used regasm. I alwyas used regsver.

Hope this helps

Dan












 
thank you for responding, but I'm trying to access a .NET component which requires regasm rather than regsrv32.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top