![]() |
| |||||||
| Sponsored Links |
![]() | « Previous Thread | Next Thread » |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| ||||
| ||||
| 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
Shem |
| Sponsored Links |
|
#2
| ||||
| ||||
| You will need to search through the repeater items to find your user control. If the user control is in the same repeater item as the button that you clicked: Code: Public Sub ActiveSpecificationsUpdate(ByVal sender As Object, ByVal e As EventArgs)
Dim btn As Button = sender
Dim FormsArt As CustomControls_form_art = btn.Parent.FindControl("FormsArt")
End Sub
Code: Public Sub ActiveSpecificationsUpdate(ByVal sender As Object, ByVal e As EventArgs)
For Each item As RepeaterItem in Repeater1.Items
Dim FormsArt As CustomControls_form_art = TryCast(item.FindControl("FormsArt"), CustomControls_form_art)
Next
End Sub
__________________ jmurrayhead If you agree with me... click the icon! If my post solved your problem, click the button in the lower right-hand corner of the post.Join our Folding team: DeveloperBarn Folding |
| The Following User Says Thank You to jmurrayhead For This Useful Post: | ||
Shem (October 7th, 2008) | ||
|
#3
| ||||
| ||||
| You effing Genius..... this totally worked: Code: Public Sub ActiveSpecificationsUpdate(ByVal sender As Object, ByVal e As EventArgs)
For Each item As RepeaterItem in Repeater1.Items
Dim FormsArt As CustomControls_form_art = TryCast(item.FindControl("FormsArt"), CustomControls_form_art)
Next
End Sub
![]() Shem |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| trying to reference my user controls properties? | Shem | .Net Development | 3 | October 3rd, 2008 04:06 AM |
| Dynamically added user control, not getting it's values | Shem | .Net Development | 11 | October 2nd, 2008 08:41 AM |
| Object Reference Error on Custom Control Postback | richyrich | .Net Development | 1 | September 22nd, 2008 05:56 PM |
| [ASP.Net - Web Controls] reference control from nested repeater | Shem | .Net Development | 18 | September 15th, 2008 10:46 AM |
| paging enabled in a repeater control | peebman2000 | .Net Development | 6 | September 4th, 2008 11:15 AM |