Solved

Help with Repeater Control

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
daypilot scheduler 3 35
Checkbox in a dynamic GridVIew is not clickable? 5 36
Error handling in asp.net site 5 34
Powerpoint 2013: Change cell reference in excel link 3 75
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.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

808 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