How to add a custom .ASP web control

Last post 07-09-2009 8:26 AM by kathirvelmm. 4 replies.

Sort Posts:

  • How to add a custom .ASP web control

    06-26-2009, 2:17 PM
    • Member
      point Member
    • lawsonmatt
    • Member since 06-26-2009, 6:13 PM
    • Posts 2

     

    Good afternoon,

     

    I am trying to add a custom .ASP web control to my Visual Studio 2005 web application project. 

    I am modifying the existing application, and am still a bit new to the whole process.

    I'm trying to use comboboxes, and discovered there are no default ones built in.

     

    Anyway, the one I am using is based on the dropdownlist web control:

    http://www.codeproject.com/KB/custom-controls/comboboxcontrol.aspx

    I've tried to use MSDN reference and other information from the web on how to do this, but haven't had any luck...

     

     

    What I did so far:

    Project->Added a custom class->put the code from the "ComboBox.cs" file in here, and named the file "combobox"

    Placed a copy of the Vortex.Web.UI.WebControls.dll in the BIN directory of the project.

    On the particular webpage where I used the combobox, I put the reference in:

    <%@ Register TagPrefix="vortex" Namespace="Vortex.Web.UI.WebControls" Assembly="Vortex.Web.UI.WebControls" %>

     

    My usage of this control is very similar to the example included,

    <vortex:combobox runat="server" enableautofill="true">

                <asp:listitem runat="server" text="one fine day" value="one"></asp:listitem>

                <asp:listitem runat="server" text="two of a kind" value="two"></asp:listitem>

                <asp:listitem runat="server" text="three blind mice" value="three"></asp:listitem>

    </vortex:combobox>

     

    However, I get the following error:

    The base class includes the field 'Combobox152', but its type (Vortex.Web.UI.WebControls.ComboBox) is not compatible with the type of control (Vortex.Web.UI.WebControls.ComboBox).

    Source Error:

    Line 404:     <vortex:combobox runat="server" enableautofill="true">

     

    Previously, these drop downs all worked fine using the standard dropdownlist control.

     

    How do I get Visual Studio to recognize this custom control?

    Thanks in advance for any insight/help,

     

    -Matt

  • Re: How to add a custom .ASP web control

    06-29-2009, 8:12 AM
    • Member
      528 point Member
    • kathirvelmm
    • Member since 05-05-2008, 3:46 AM
    • Chennai-India
    • Posts 160

    we have a dropdown list in asp.net 2.0 why to have a third party web control

    Kathirvel
    Follow me here
    Please mark as Answer if this solves your problem, Let other users get benefited.


  • Re: How to add a custom .ASP web control

    06-29-2009, 8:52 AM
    • Member
      point Member
    • lawsonmatt
    • Member since 06-26-2009, 6:13 PM
    • Posts 2

    I need the combobox functionality: dropdown list and being able to type in the text.

    Thanks.


    -Matt


  • Re: How to add a custom .ASP web control

    07-01-2009, 11:54 PM
    Answer

     Hi,

    How did you create this custom control? We can create it in Class Library project and add reference to this custom control's dll, and add it to Toolbox and then we can drag and drop it on ASP.NET page.

    In your case, please make sure your custom control is correct.

    For more information, see Developing Custom ASP.NET Server Controls (http://msdn.microsoft.com/en-us/library/zt27tfhy.aspx).

    I look forward to receiving your test results.

    Thomas Sun
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
  • Re: How to add a custom .ASP web control

    07-09-2009, 8:26 AM
    • Member
      528 point Member
    • kathirvelmm
    • Member since 05-05-2008, 3:46 AM
    • Chennai-India
    • Posts 160

    Missing part

    <%@ Register TagName="MailControl" TagPrefix="mkv" Src="~/MailPanelControl.ascx" %>


    <form>

    <mkv:MailControl ID="cntrl_ld" runat="server" />

    </form>


    add control in this format and check if you have the .ascx in same project


    Kathirvel
    Follow me here
    Please mark as Answer if this solves your problem, Let other users get benefited.


Page 1 of 1 (5 items)