Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

Use a DLL in an ASP.net page

Hello all, this is likely a simple question but I am having trouble tracking down exactly what I'm looking for on google.  Since I am primarily a WINAPP developer and relatively new to ASP I thought here would be a good place to ask my question.  I have a dll that I created in VB.net 2008 that does some database hooks and business logic.  I need to migrate the application from WINAPP to ASP and I'd like to just use the existing DLL since I know that the code is sound.  Is there a way that I can call the DLL function from within an ASP page on a button click event and have the routine run on the server?  
0
jclemo
Asked:
jclemo
  • 3
  • 2
1 Solution
 
Ved Prakash AgrawalDatabase Consultant/Performance ArchitectCommented:
ye.
You can give reference of that DLL in your application e.g. Asp.net or in asp you can use createobject to use that DLL.

before using that dll in your application you have to register that DLL.
use below command in command prompt,

regsvr32 fullpathofDLL

0
 
jclemoAuthor Commented:
Thanks for the response, would I have to register the DLL on the IIS server or on the individual machines accessing the site?
0
 
philipjonathanCommented:
I suppose you are using ASP.NET, not the classic ASP, right?
If so, it is quite simple, you just need to:
1. In your ASP.NET project, add reference to your DLL.
2. In the page's code-behind, append the appropriate "using" statement.
3. Add event-handler to your button
4. Call the object in the DLL as you would in a WINAPP
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
jclemoAuthor Commented:
Thanks for the response philipjonathan, do I just put the DLL in the bin file of the virtual directory?
0
 
philipjonathanCommented:
If you add reference to the DLL, and compile the ASP.NET project, the DLL will be copied automatically to the bin directory of your ASP.NET project.

You can add reference to the DLL the same way you would in a WinApp:
1. From Visual Studio, open Solution Explorer
2. Right-click your ASP.NET project
3. Choose "Add Reference..."
0
 
jclemoAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now