Using the same User Control multiple times on one page

Discussion in 'ASP .Net Building Controls' started by Raith, Jul 6, 2005.

  1. Raith

    Raith Guest

    How can I reuse a User Control multiple times on a single page?
    I have one created that pulls and hyperlinks the most recent news items from the database.
    I want to reuse it multiple times, one instance in each javascript dropdown menu on the page.
    I plan to pass the catagoryID via each individual menu node, but my problem is in trying to register and reuse this control.
    One always shows up alright and the other has nothing. I have tried registering twice above, using different prefixes, using different tags, etc.
    Is it possible to reuse a control like this several times on the same page?

    Thanks.

    From http://www.developmentnow.com/g/10_0_0_0_0_0/dotnet-framework-aspnet-buildingcontrols.htm

    Posted via DevelopmentNow.com Groups
    http://www.developmentnow.com
     
    Raith, Jul 6, 2005
    #1
    1. Advertisements

  2. Raith

    smyersm Guest

    I create controls and reuse them an unlimited number of times in a
    page.

    Dim X as new coolControl()
    Dim Y as new coolControl()

    Controls.Add(X)
    Controls.Add(Y)

    I dont know the specifics from YOUR control, but i have over 50
    controls, some extended from others, some brand new. Good luck
     
    smyersm, Jul 7, 2005
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.