Reference User Control in nested repeater
Hi again 
the scenario:
my user control is loaded into a ModalPopupExtender via OnItemDataBound of
a repeater sitting in the diaplay Panel of the ModalPopup.
inside that panel is an update button which fires an event, which in turn fires
an update event in my user control's code-behind.
All of this is happening within a nested repeater (grandchild), and this is what
makes it difficult to reference controls etc.
here's my logic:
the sender is the 'Update Button'
from there I can reference the Panel the button resides in
from there I can reference the Repeater that resides in the Panel.
this all works, so from there I wanted to reference my UserControl that
was in the repeater, but alas it doesn't find my UserControl. 
my code for the Update event of my Update Button:
green = works
red = doesn't work
Code:
Public Sub ActiveSpecificationsUpdate(ByVal sender As Object, ByVal e As EventArgs)
Dim myButton As Button = sender
Dim pnlActiveSpecification As Panel = myButton.Parent
Dim rpActiveSpecification As Repeater = pnlActiveSpecification.FindControl("rpActiveSpecification")
If CType(ViewState("FormsArt"), String) = "1" Then
Dim FormsArt As CustomControls_form_art = rpActiveSpecification.FindControl("FormsArt")
FormsArt.SpecID = myParams.SpecID
FormsArt.Visible = True
FormsArt.Update_Form()
ViewState("FormsArt") = "0".ToString()
End If
End Sub
any ideas?
Shem
Shem, October 3rd, 2008 03:57 AM
Bookmarks