Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help with Repeater Control

Posted on 2009-05-13
3
Medium Priority
?
453 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 1000 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 1000 total points
ID: 24384266
0
 

Author Closing Comment

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

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

609 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