Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Use a DLL in an ASP.net page

Posted on 2008-06-18
6
Medium Priority
?
203 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 11

Expert Comment

by:Ved Prakash Agrawal
ID: 21810908
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
ID: 21810914
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
ID: 21810915
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
Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

 

Author Comment

by:jclemo
ID: 21819412
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 500 total points
ID: 21819452
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
ID: 31468242
Thanks
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

604 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