using a c# DLL in ASP

T

Tim Wallace

I'm a .Net noob. I created a dll using c#. Now, I want to reference that
DLL in an ASPX page. I put the import directive in the page like this:

<%@ Import Namespace="BHQ.BusinessLogicLayer" %>

but keep getting this error:

CS0246: The type or namespace name 'BHQ.BusinessLogicLayer' could not be
found (are you missing a using directive or an assembly reference?)

What are the procedures for using/registering a DLL in ASP.Net?

Tim
 
S

Scott Allen

Hi Tim:

You have imported the namespace, now you just need to tell ASP.NET the
name of the assembly you want to reference.

One way is to use the @ Assembly directive in the page.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconassembly.asp

Since you'll probably use the assembly in more than one page, you can
also reference assemblies in the web.config file.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfassemblies.asp

Also, with the default settings, any assembly in the web application's
bin directory is automatically referenced.

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top