Using a dll user control in ASP.NET

  • Thread starter Thread starter Mike Street
  • Start date Start date
M

Mike Street

I'm looking for the best way to make se of the function is a dll user
control in an ASP.NET page. I've been unable to find anything specific to
demonstrate how this can be achieved.

Mike
 
Could you ask that in more understandable terms, please?

What is "a dll user control?" And what do you mean by "the best way to make
se of the function i[n] a dll user control"?

The best way to make use of a hammer is to hammer nails with it. The best
way to make use of any tool is to use it for what it is designed for.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Kevin,
I've got a .NET dll which I would normally use within a VB.NET application.
It provides me with a set of classes and functions I can use to connect to a
back-end server. I'd like to be able to make use of those same classes and
functions in an ASP.NET page.

In an ASP page I would use the CreateObject() function to make use of the
classes in the equivalent COM object.

Mike

Kevin Spencer said:
Could you ask that in more understandable terms, please?

What is "a dll user control?" And what do you mean by "the best way to
make
se of the function i[n] a dll user control"?

The best way to make use of a hammer is to hammer nails with it. The best
way to make use of any tool is to use it for what it is designed for.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Mike Street said:
I'm looking for the best way to make se of the function is a dll user
control in an ASP.NET page. I've been unable to find anything specific to
demonstrate how this can be achieved.

Mike
 
Okay, Mike. What you have is not a "Control" - a Control in ASP.Net is a
class which renders UI. It sounds like what you've got is a Class Library.
If so, all you need to do is create a reference to the DLL, and use it like
any other .Net DLL (Such as the built-in System.DLL, System.Web.DLL, etc).

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Mike Street said:
Kevin,
I've got a .NET dll which I would normally use within a VB.NET application.
It provides me with a set of classes and functions I can use to connect to a
back-end server. I'd like to be able to make use of those same classes and
functions in an ASP.NET page.

In an ASP page I would use the CreateObject() function to make use of the
classes in the equivalent COM object.

Mike

Kevin Spencer said:
Could you ask that in more understandable terms, please?

What is "a dll user control?" And what do you mean by "the best way to
make
se of the function i[n] a dll user control"?

The best way to make use of a hammer is to hammer nails with it. The best
way to make use of any tool is to use it for what it is designed for.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Mike Street said:
I'm looking for the best way to make se of the function is a dll user
control in an ASP.NET page. I've been unable to find anything specific to
demonstrate how this can be achieved.

Mike

 
Kevin,
As in :

@Register TagPrefix="MyClass" Namespace="CustomControls"
Assembly="~\Controls\My.dll" ?

Mike

Kevin Spencer said:
Okay, Mike. What you have is not a "Control" - a Control in ASP.Net is a
class which renders UI. It sounds like what you've got is a Class Library.
If so, all you need to do is create a reference to the DLL, and use it
like
any other .Net DLL (Such as the built-in System.DLL, System.Web.DLL, etc).

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Mike Street said:
Kevin,
I've got a .NET dll which I would normally use within a VB.NET application.
It provides me with a set of classes and functions I can use to connect
to a
back-end server. I'd like to be able to make use of those same classes
and
functions in an ASP.NET page.

In an ASP page I would use the CreateObject() function to make use of the
classes in the equivalent COM object.

Mike

Kevin Spencer said:
Could you ask that in more understandable terms, please?

What is "a dll user control?" And what do you mean by "the best way to
make
se of the function i[n] a dll user control"?

The best way to make use of a hammer is to hammer nails with it. The best
way to make use of any tool is to use it for what it is designed for.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

I'm looking for the best way to make se of the function is a dll user
control in an ASP.NET page. I've been unable to find anything specific to
demonstrate how this can be achieved.

Mike


 
Well, what environment are you developing in?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Mike Street said:
Kevin,
As in :

@Register TagPrefix="MyClass" Namespace="CustomControls"
Assembly="~\Controls\My.dll" ?

Mike

Kevin Spencer said:
Okay, Mike. What you have is not a "Control" - a Control in ASP.Net is a
class which renders UI. It sounds like what you've got is a Class Library.
If so, all you need to do is create a reference to the DLL, and use it
like
any other .Net DLL (Such as the built-in System.DLL, System.Web.DLL, etc).

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Mike Street said:
Kevin,
I've got a .NET dll which I would normally use within a VB.NET application.
It provides me with a set of classes and functions I can use to connect
to a
back-end server. I'd like to be able to make use of those same classes
and
functions in an ASP.NET page.

In an ASP page I would use the CreateObject() function to make use of the
classes in the equivalent COM object.

Mike

Could you ask that in more understandable terms, please?

What is "a dll user control?" And what do you mean by "the best way to
make
se of the function i[n] a dll user control"?

The best way to make use of a hammer is to hammer nails with it. The best
way to make use of any tool is to use it for what it is designed for.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

I'm looking for the best way to make se of the function is a dll user
control in an ASP.NET page. I've been unable to find anything
specific
to
demonstrate how this can be achieved.

Mike

 
Kevin,
Windows XP, .NET 1.1, VS .NET 2003

Mike


Kevin Spencer said:
Well, what environment are you developing in?

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Mike Street said:
Kevin,
As in :

@Register TagPrefix="MyClass" Namespace="CustomControls"
Assembly="~\Controls\My.dll" ?

Mike

Kevin Spencer said:
Okay, Mike. What you have is not a "Control" - a Control in ASP.Net is
a
class which renders UI. It sounds like what you've got is a Class Library.
If so, all you need to do is create a reference to the DLL, and use it
like
any other .Net DLL (Such as the built-in System.DLL, System.Web.DLL, etc).

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Kevin,
I've got a .NET dll which I would normally use within a VB.NET
application.
It provides me with a set of classes and functions I can use to
connect
to
a
back-end server. I'd like to be able to make use of those same classes
and
functions in an ASP.NET page.

In an ASP page I would use the CreateObject() function to make use of the
classes in the equivalent COM object.

Mike

Could you ask that in more understandable terms, please?

What is "a dll user control?" And what do you mean by "the best way to
make
se of the function i[n] a dll user control"?

The best way to make use of a hammer is to hammer nails with it. The
best
way to make use of any tool is to use it for what it is designed
for.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

I'm looking for the best way to make se of the function is a dll user
control in an ASP.NET page. I've been unable to find anything specific
to
demonstrate how this can be achieved.

Mike


 
Add the DLL as a reference in your project references. Use an Imports
statement in your CodeBehind class:

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Mike Street said:
Kevin,
Windows XP, .NET 1.1, VS .NET 2003

Mike


Kevin Spencer said:
Well, what environment are you developing in?

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Mike Street said:
Kevin,
As in :

@Register TagPrefix="MyClass" Namespace="CustomControls"
Assembly="~\Controls\My.dll" ?

Mike

Okay, Mike. What you have is not a "Control" - a Control in ASP.Net is
a
class which renders UI. It sounds like what you've got is a Class Library.
If so, all you need to do is create a reference to the DLL, and use it
like
any other .Net DLL (Such as the built-in System.DLL, System.Web.DLL, etc).

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Kevin,
I've got a .NET dll which I would normally use within a VB.NET
application.
It provides me with a set of classes and functions I can use to
connect
to
a
back-end server. I'd like to be able to make use of those same classes
and
functions in an ASP.NET page.

In an ASP page I would use the CreateObject() function to make use
of
the
classes in the equivalent COM object.

Mike

Could you ask that in more understandable terms, please?

What is "a dll user control?" And what do you mean by "the best
way
to
make
se of the function i[n] a dll user control"?

The best way to make use of a hammer is to hammer nails with it. The
best
way to make use of any tool is to use it for what it is designed
for.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

I'm looking for the best way to make se of the function is a dll user
control in an ASP.NET page. I've been unable to find anything specific
to
demonstrate how this can be achieved.

Mike


 
Hi Mike,

As Kevin has mentioned, the component dll is quite different from the
asp.net control (which is for web page UI design). And since you said that
the component is used be used in asp app as COM object, i think we need to
use .net's COM interop service to call the component rather than call it
directly.

#Microsoft .NET/COM Migration and Interoperability
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/
cominterop.asp

#Introduction to COM Interop
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn7/html/
vaconintroductiontocominteroperability.asp

and when we use the "Add Reference" in VS.NET to refernce a COM dll in .net
application, the VS.NET IDE will automatically create the .net wrapper
classes(which can be directly used in managed code) for the COM components.

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
Steven,
I have a .NET version of the dll, so I don't need to worry about COM
Interop.

I've now found a couple of examples which give me a basic framework to build
on.

Thanks,
Mike
 
Back
Top