Using my own controls in webforms

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.
 
D

Daniel Fisher\(lennybacon\)

Just add

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

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

to your webform.
 

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