Solved

Use a DLL in an ASP.net page

Posted on 2008-06-18
6
193 Views
Last Modified: 2013-11-26
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
Comment
Question by:jclemo
  • 3
  • 2
6 Comments
 
LVL 11

Expert Comment

by:Ved Prakash Agrawal
Comment Utility
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
 

Author Comment

by:jclemo
Comment Utility
Thanks for the response, would I have to register the DLL on the IIS server or on the individual machines accessing the site?
0
 
LVL 18

Expert Comment

by:philipjonathan
Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:jclemo
Comment Utility
Thanks for the response philipjonathan, do I just put the DLL in the bin file of the virtual directory?
0
 
LVL 18

Accepted Solution

by:
philipjonathan earned 125 total points
Comment Utility
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
 

Author Closing Comment

by:jclemo
Comment Utility
Thanks
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction (All good things must come to an end (http://en.wikipedia.org/wiki/All_Good_Things...)) The original MySQL API (http://php.net/manual/en/book.mysql.php) has gone away, deprecated by PHP in Version 5.5, and removed from PHP in all curre…
Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now