title: asp.net add custom control in website
body: <p>I want to make a custom control in my website (note: not web application)</p>
  
  <p>Following is the code</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.ComponentModel;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  
  namespace AnkitControls
  {
      /// &lt;summary&gt;
      /// Summary description for CustomTreeView
      /// &lt;/summary&gt;
      public class CustomTreeViewControl : WebControl
      {
  
      }
  }
  </code></pre>
  
  <p>Default.aspx :</p>
  
  <pre><code>&lt;%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
      CodeFile="Default.aspx.cs" Inherits="_Default" %&gt;
      &lt;%@ Register Assembly="AnkitControls" Namespace="AnkitControls" TagPrefix="CustomCtrl" %&gt;
  &lt;asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&gt;
      &lt;h2&gt;
          Welcome to ASP.NET!
      &lt;/h2&gt;
      &lt;p&gt;
          To learn more about ASP.NET visit &lt;a href="http://www.asp.net" title="ASP.NET Website"&gt;www.asp.net&lt;/a&gt;.
      &lt;/p&gt;
      &lt;p&gt;
          You can also find &lt;a href="http://go.microsoft.com/fwlink/?LinkID=152368&amp;amp;clcid=0x409"
              title="MSDN ASP.NET Docs"&gt;documentation on ASP.NET at MSDN&lt;/a&gt;.
      &lt;/p&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>When i compile the site, it gives me error for assembly.</p>
  
  <p>Error = "The type or namespace name 'AnkitControls' does not exist in the namespace 'AnkitControls' (are you missing an assembly reference?)"</p>