Hi All, I have a problem in something I want to do and would like some guidance or code to help me make this work. I have thought of a simple example and created a template static webpage which should help get my idea across!! Basically I have a repeater
which repeats a tables with a header, product description and a footer for each product and the footer of each product has a show or hide description button in it. If then the hide description button for that product is clicked I want the page to postback
and hide the description for just that item, and then of course to swap the link in the footer for a show description link. Also I need show all descriptions, and hide all descriptions on the top of the page. Here is the mock up example I have done to demonstrate
what I mean: RepeaterProblemExample.htm Any tips or help will be greatly appreciated!!
Public Sub Button_Command(ByVal s As Object, ByVal e As CommandEventArgs)
Select Case e.CommandName
Case "visible"
Dim Panel1 As Panel = CType(CType(s, Control).Parent, RepeaterItem).FindControl("Panel1")
If Panel1.Visible Then
Panel1.Visible = False
Else
Panel1.Visible = True
End If
End Select
End Sub
Ahh I see what your doing here, the asp:panel is something I have yet to play with... Does this mean inside the panel you can insert code, html and even more controls?? For example if you had a nested repeater for part of the product descriptionthat would
still work fine?? Im on the case trying this... but a little explanation of what the panel does would be great :)
MrCarl
Member
425 Points
94 Posts
Show / Hide buttons for product descriptions rendered in repeater
Aug 10, 2004 11:43 AM|LINK
Hi All, I have a problem in something I want to do and would like some guidance or code to help me make this work. I have thought of a simple example and created a template static webpage which should help get my idea across!! Basically I have a repeater which repeats a tables with a header, product description and a footer for each product and the footer of each product has a show or hide description button in it. If then the hide description button for that product is clicked I want the page to postback and hide the description for just that item, and then of course to swap the link in the footer for a show description link. Also I need show all descriptions, and hide all descriptions on the top of the page. Here is the mock up example I have done to demonstrate what I mean: RepeaterProblemExample.htm Any tips or help will be greatly appreciated!!
jef06
Participant
895 Points
179 Posts
Re: Show / Hide buttons for product descriptions rendered in repeater
Aug 10, 2004 12:47 PM|LINK
Public Sub Button_Command(ByVal s As Object, ByVal e As CommandEventArgs) Select Case e.CommandName Case "visible" Dim Panel1 As Panel = CType(CType(s, Control).Parent, RepeaterItem).FindControl("Panel1") If Panel1.Visible Then Panel1.Visible = False Else Panel1.Visible = True End If End Select End Sub"Jef"
MrCarl
Member
425 Points
94 Posts
Re: Show / Hide buttons for product descriptions rendered in repeater
Aug 10, 2004 01:41 PM|LINK
Ahh I see what your doing here, the asp:panel is something I have yet to play with... Does this mean inside the panel you can insert code, html and even more controls?? For example if you had a nested repeater for part of the product descriptionthat would still work fine?? Im on the case trying this... but a little explanation of what the panel does would be great :)
MrCarl
Member
425 Points
94 Posts
Re: Show / Hide buttons for product descriptions rendered in repeater
Aug 10, 2004 02:42 PM|LINK
jef06
Participant
895 Points
179 Posts
Re: Show / Hide buttons for product descriptions rendered in repeater
Aug 10, 2004 06:06 PM|LINK
"Jef"