trying to reference my user controls properties?
Hi
I have a user control in a repeater.
in my repeaters OnItemDataBound event, i check to see if I must
set the control to be visible, and at the same time need to set a property
of that control, which I can only do in the code-behind
my repeater and user control:
Code:
<asp:Repeater ID="rpActiveSpecification" runat="server">
<ItemTemplate>
<tr>
<td>
<asp:Panel ID="pnlActiveSpecificationForms" runat="server">
<forms:art ID="FormsArt" runat="server" Visible="false" />
</asp:Panel>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
my OnItemDataBound: (red)
Code:
Protected Sub rpActiveSpecification_OnItemDataBound(ByVal s As Object, ByVal e As RepeaterItemEventArgs)
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
'---------------------------------------
Dim myForms As Forms = e.Item.DataItem
'---------------------------------------
Select Case myForms.Name
Case "Art"
Dim FormsArt As UserControl = e.Item.FindControl("FormsArt")
Case "Carpet Rug"
Case "Accessories"
Case "Bedding"
Case "Casegoods"
Case "Drapery"
Case "Fabric"
Case "Lighting"
Case "Mirrors"
Case "Pillow"
Case "Trims"
Case "Uplholstered"
Case "Architectural Schedule"
End Select
End If
End Sub
The property i'm trying to set is 'SpecID'.
when i loaded the controls dynamically I could set the property?
My user controls are all registered in my web.config.
Shem
Shem, October 2nd, 2008 11:19 AM
Bookmarks