How do I implement a custom control (extended DropDownList) on a web form?

Posted on 2006-04-05
Last Modified: 2008-02-01
I have a custom control MyDropDownList that extends DropDownList (i.e. it is not a UserControl it is a "DropDownList").
How do I declare this control on a web form?
Question by:smacca
    LVL 44

    Accepted Solution

    Hi smacca,

    <%@ Register TagPrefix="MyDDL" Namespace="MyApp.MyNameSpace" Assembly="MyAssembly" %>

    Then simply use:

    <MyDDL:MyDropDownList runat="Server" />

    With any attributes you have included there.

    Tim Cottee
    LVL 10

    Expert Comment



    add rweference in your project (If required)

    <%@ Register TagPrefix="XYZ" Namespace="YourProject.Web.Controls.CustomControl" Assembly="YourCustomControl" %>

    use like this <XYZ:datepicker id="DatePicker1"</XYZ:datepicker>


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    779 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

    12 Experts available now in Live!

    Get 1:1 Help Now