Solved

Help with Repeater Control

Posted on 2009-05-13
3
451 Views
Last Modified: 2012-05-06
How can I show and hide a DIV tag from the code behind where the DIV is INSIDE a Repeater control?

It's important to note that the DIV is inside the repeater.  I have no problem doing a show/hide from the code behind on a DIV that's OUTSIDE the repeater.  My problem is doing it when it's inside the repeater.  

Thanks!
0
Comment
Question by:cdemott33
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 8

Accepted Solution

by:
ppittle earned 250 total points
ID: 24381756
Case 1 - Hide Client Side w/ JavaScript:

<asp:Repeator .... >
<ItemTemplate>
<div ID="InnerDiv" runat="server" onclick='<%# string.Format("javascriptFunction('{0}')",InnerDiv.ClientID) %>' />
</ItemTemplate></asp:Repeator>

Case 2 - Hide Server Side - Code Behind
<asp:Repeator ID="MyRepeator" OnItemCreated="MyRepeator_ItemCreated" ... >
<ItemTemplate>
<div ID="InnerDiv" runat="server" />
</ItemTemplate
</asp:Repeator>
<%--Code Behind --%>
Sub MyRepeator_ItemCreated(Sender As Object, e As RepeaterItemEventArgs)
//Get a reference to the Div
Control innerDiv = e.Item.FindControl("InnerDiv")

End Sub
0
 
LVL 8

Assisted Solution

by:Faheem Shaikh
Faheem Shaikh earned 250 total points
ID: 24384266
0
 

Author Closing Comment

by:cdemott33
ID: 31581302
Thank you both for your suggestion.  They were helpful.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question