How to reference to a custom class library

Posted on 2007-09-27
Last Modified: 2008-09-12

I've created a C# class library and compiled into a DLL. Here is the code -

            using System;

            /// <summary>
            /// Summary description for DateReturn
            /// </summary>
            namespace weborb.tests
                public class DateReturn
                    public DateTime echoDate(DateTime date)
                        return date;

Simple class to return the date.

All i want to do now is check that this is working. So i've added a reference in visual studio, and added the following line in my web.config -

          <add tagPrefix="weborb" namespace="weborb.tests" assembly="DateReturn"/>

How do reference to this in my default.aspx.cs codebehind file? When i run the application it gives me an error stating -
"The type or namespace name 'ClassLibrary1' could not be found (are you missing a using directive or an assembly reference?)"

here is my default.aspx.cs file -

            using System;
            using System.Data;
            using System.Configuration;
            using System.Collections;
            using System.Web;
            using System.Web.Security;
            using System.Web.UI;
            using System.Web.UI.WebControls;
            using System.Web.UI.WebControls.WebParts;
            using System.Web.UI.HtmlControls;

            namespace RemotingTestProject
                public partial class _Default : System.Web.UI.Page
                    protected void Page_Load(object sender, EventArgs e)

                        ClassLibrary1 objDate = new ClassLibrary1();

Look forward to your replies.

Question by:Fracture
    1 Comment
    LVL 21

    Accepted Solution

    Date return is ur class not a method. Here is the way to use it

                        protected void Page_Load(object sender, EventArgs e)
                            weborb.tests.DateReturn objDate = new weborb.tests.DateReturn();

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Suggested Solutions

    A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    This video discusses moving either the default database or any database to a new volume.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    746 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

    14 Experts available now in Live!

    Get 1:1 Help Now