Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Multiple User Controls

Reply
Thread Tools

Multiple User Controls

 
 
Steven Clark
Guest
Posts: n/a
 
      05-06-2007
Hi

Hope someone can help.

I wish to use the same user control, twice on the one page but everytime I
do it things go wrong.

This control is my own custom version of the ad-rotator which query's a
database to return a random image. The control has 3 public properties...
height, width & Filter. The control will exist inside another user control
i.e. I have a control for the header and another for the side bar and this
control will appear in both and then on a master page.

Every time I do this, the first ad user control on the page sets itself to
the same values as the second control on the page. I have tried placing the
controls manually and loading progmatically but with no luck.


I have tried the following:

<%@ Register Src="../components/adRotator.ascx" TagName="adRotator"
TagPrefix="uc1" %>
<uc1:adRotator id="AdRotator1" runat="server" Height="72px" Width="392px"
filter="T"></uc1:adRotator>
<uc1:adRotator id="AdRotator2" runat="server" Height="240px" Width="120px"
filter="T"></uc1:adRotator>

and
<%@ Register Src="../components/adRotator.ascx" TagName="adRotator"
TagPrefix="uc1" %>
<%@ Register Src="../components/adRotator.ascx" TagName="adRotator"
TagPrefix="uc2" %>
<uc1:adRotator id="AdRotator1" runat="server" Height="72px" Width="392px"
filter="T"></uc1:adRotator>
<uc2:adRotator id="AdRotator2" runat="server" Height="240px" Width="120px"
filter="T"></uc2:adRotator>

Please let me know if you need any more code extracts.

I hope you can help.

Steven

 
Reply With Quote
 
 
 
 
John Saunders [MVP]
Guest
Posts: n/a
 
      05-06-2007
"Steven Clark" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
>
> Hope someone can help.
>
> I wish to use the same user control, twice on the one page but everytime I
> do it things go wrong.
>
> This control is my own custom version of the ad-rotator which query's a
> database to return a random image. The control has 3 public properties...
> height, width & Filter. The control will exist inside another user
> control i.e. I have a control for the header and another for the side bar
> and this control will appear in both and then on a master page.
>
> Every time I do this, the first ad user control on the page sets itself to
> the same values as the second control on the page. I have tried placing
> the controls manually and loading progmatically but with no luck.
>
>
> I have tried the following:
>
> <%@ Register Src="../components/adRotator.ascx" TagName="adRotator"
> TagPrefix="uc1" %>
> <uc1:adRotator id="AdRotator1" runat="server" Height="72px" Width="392px"
> filter="T"></uc1:adRotator>
> <uc1:adRotator id="AdRotator2" runat="server" Height="240px" Width="120px"
> filter="T"></uc1:adRotator>
>
> and
> <%@ Register Src="../components/adRotator.ascx" TagName="adRotator"
> TagPrefix="uc1" %>
> <%@ Register Src="../components/adRotator.ascx" TagName="adRotator"
> TagPrefix="uc2" %>
> <uc1:adRotator id="AdRotator1" runat="server" Height="72px" Width="392px"
> filter="T"></uc1:adRotator>
> <uc2:adRotator id="AdRotator2" runat="server" Height="240px" Width="120px"
> filter="T"></uc2:adRotator>


Do you have any static (Shared in VB.NET) data? If so, that data would be
shared between the two instances of the control.
--
John Saunders [MVP]


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Controls.Count, Controls.IsSynchronized, and Controls.SyncRoot Nathan Sokalski ASP .Net 4 09-05-2007 03:27 AM
using javascript in User controls to access server controls of the user control Faizan Ahmed ASP .Net Building Controls 1 01-04-2005 04:09 PM
using javascript in User controls to access server controls of the user control Faizan Ahmed ASP .Net Web Controls 1 01-04-2005 04:09 PM
Multiple controls with the same ID '_ctl24' were found. Trace requires that controls have unique IDs Jeff Tolman ASP .Net 0 11-04-2003 09:53 PM
HTML Controls and User controls trinitypete ASP .Net 6 06-26-2003 09:47 AM



Advertisments