Solved

Help with Repeater Control

Posted on 2009-05-13
3
447 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
Comment Utility
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
Comment Utility
0
 

Author Closing Comment

by:cdemott33
Comment Utility
Thank you both for your suggestion.  They were helpful.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now