I have a repeater that lists emails directly from an app tied to my Outlook. I need the repeater to list the folder name then each message in that folder. What I get, however, is the folder name getting repeated for every message in that folder.
I'm also trying to use jquery to toggle the folder name to show the messages underneath it, but when I use style="display:none;" no messages are shown. I don't think the jquery I am trying to use is right. It's called jsfiddle.
Any help would be appreciated, as I am drawing a blank. I've been staring at this for far too long and probably just need a break.
Here's my code:
<script type="text/javascript">
$(function () {
$('a.toggler').on('click', function () {
$('+ div', this).toggle();
});
});
</script>
<asp:Repeater runat="server" ID="ListServRepeater">
<ItemTemplate>
<div class="dataContentSection">
<a href="javascript:void(0);" class="folders toggler">
<h4>
<%# Eval("FolderName") %>
</h4>
</a>
</div>
<div class="dataContentSection">
<div>
<%# Eval("Message") %>
</div>
</div>
</ItemTemplate>
</asp:Repeater>
EDIT: I nested the repeaters, but I must not be doing something right because all the FolderNames still show with every message.
<div runat="server">
<ul>
<asp:Repeater runat="server" ID="FolderRepeater">
<ItemTemplate>
<li class="dataContentSection">
<a href="javascript:void(0);" class="folders toggler">
<h4>
<%# Eval("FolderName") %>
</h4>
</a>
</li>
<asp:Repeater runat="server" ID="MessagesRepeater">
<ItemTemplate>
<li class="dataContentSection" >
<div id="messages">
<%# Eval("Message") %>
</div>
</li>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
</ul>
</div>
UPDATE: I was able to get the repeaters working thanks to @rs for providing an article to help. If you look in the comments, the article should still be there. I pretty much took it word for word and replaced column names and whatever else was relevant to my code. Still looking at jquery and can't figure out why it won't work. The only thing I can think of is that it is dynamic, not static, data that I'm trying to show and hide.
<div class="dataContentSection">
<a href="javascript:void(0);" class="folders toggler">
<h4>
Folder Name
</h4>
</a>
</div>
<ul>
<div class="dataContentSection">
<div id="message">
Message Text
</div>
</div>
</ul>
</div>