Using my own controls in webforms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

This is a ASP.NET 2.0 question.

I have created a new derived control similar to:

public class MyButton : System.Web.UI.WebControls.Button
{

}

I now want to use this new control in a webform *in the same project* rather
than as a seperate assembly. Is this possible and if so how? Do I need to add
the control to the toolbox? If so how? I am using ASP.NET 2.0 and VS2005 and
theres no 'bin' directory of the application. What is the namespace of the
project I am working on?

Thanks, Paul.
 
Just add

<%@ Register TagPrefix="ctrl" namespace="{namespace}" assembly="{name of
your project dll}" %>

<ctrl:MyButton ID="MyButton1" runat="server" />

to your webform.
 
Back
Top