Solved

Help with Repeater Control

Posted on 2009-05-13
3
448 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
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

773 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