Click here to Skip to main content
15,895,813 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hey all
im gonna try to be as clear as I can so here is my scenario:

I have a news page that has repeater displaying top 5 news using JQuery UI accordion

I also have a news block in my home page whose content displays those 5 news one at a time every 10 seconds(part of the news Item with a "Read more link"). For this, I also used a repeater and i only showed the div that i was interested in

My problem is the following:
when I click on the "Read more" link in the news block in the home page, i want to navigate to the main news page and open the respective accordion item

News Block Repeater:

XML
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="EntityDataSource1" ItemType="JqueyAnimations.DAL.News">
        <ItemTemplate>
            <div class="newsItem">
                <h3>
                    <asp:Image ID="Image1" ImageUrl="<%#Item.NewsImagePath %>"
                        Visible='<%# Item.NewsImagePath!=null %>' Width="75" Height="75" runat="server" />
                    <%#Item.NewsTitle %>

                </h3>
                <div>

                    <%#Item.NewsBody %>
                </div>
            </div>
        </ItemTemplate>
    </asp:Repeater>


News Block JS:

C#
$(document).ready(function () {
            $('div.newsItem').hide();
            $($('div.newsItem')[0]).show();
            //alert('ok');
            var count = 1;
            setInterval(function () {
                showItem(count % 5);
                count++;

            }, 3000);

        })
        function showItem(ind) {
            $('div.newsItem').hide();
            $($('div.newsItem')[ind]).fadeIn();

        }


News Page Repeater:

XML
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="EntityDataSource1" ItemType="JqueyAnimations.DAL.News">
                <ItemTemplate>

                    <h3>
                        <asp:image id="Image1" imageurl="<%#Item.NewsImagePath %>"
 Visible ='<%# Item.NewsImagePath!=null %>' Width="75" Height="75" runat="server" />
                        <%#Item.NewsTitle %>

                    </h3>
                    <div>

                        <%#Item.NewsBody %>
                    </div>
                </ItemTemplate>
            </asp:Repeater>



Thanks
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900