Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8275693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:09:30+00:00 2026-06-08T08:09:30+00:00

I have a repeater which displays and data bind the source of tab links.

  • 0

I have a repeater which displays and data bind the source of tab links. Here is the code:

protected void rptTab_ItemBound(Object sender, RepeaterItemEventArgs e)
{
    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
    {
        Item i = e.Item.DataItem as Item;
        Link hlTabLink = e.Item.FindControl("hlTabLink") as Link;
        hlTabLink.Target = Sitecore.Links.LinkManager.GetItemUrl(i);
        hlTabLink.DataSource = i.Paths.FullPath;
        hlTabLink.Field = "Title";
    }
}

Now this is my markup:

<asp:Repeater ID="rptTab" runat="server" OnItemDataBound="rptTab_ItemBound">
            <ItemTemplate>
                <li id= "liTabTest" runat = "server">
                    <a>
                        <sc:Link ID = "hlTabLink" Field = "scTabLink" onclick = "TabClick()" runat ="server"></sc:Link>
                    </a>
                </li>
            </ItemTemplate>
       </asp:Repeater>

And this is the jQuery which is adding CSS class dynamically based on which item is selected:

$(document).ready(function () {
    init();
});

function init() {
    $("ul#Tab-labels li").removeClass("tab-label TabbedPanelsTabSelected");
    $("ul#Tab-labels li:first").addClass("tab-label TabbedPanelsTabSelected");
};

function TabClick() {
    alert('test');
};

Now you can see that I am displaying the CSS file based on the index of the tab. I also have to add the click event in that jQuery. So there are basically two things that I am confused:

  • My click event in jQuery is not getting called 🙁
  • From jQuery I have to know in the click event that which page it has
    to go through? So that I have to get from codebehind or what? Like a
    hidden field and store the tab pages in that, then fetch out from
    jQuery.

How should I resolve this? Please help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T08:09:33+00:00Added an answer on June 8, 2026 at 8:09 am

    For sc:Link, change the bind method to onClientClick for onclick = "TabClick()". OnClick is for the postback server method.

    BTW, what is the sc prefix? Is there a user control you are adding to the page?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a repeater, which is dynamically created on tab index change of AJAX
I have a repeater which displays comments related to a post. I want to
I have a repeater which binds a set of data. Within this repeater is
Here's my situtation. I have a Repeater bound to a List, which is rendering
I have a fragment which pulls down data from a webservice and displays this
I have a repeater which fetches data from a database and shows some labels
I have a repeater trying to get multiple data to display. which includes a
I have an objectdatasource which i want to bind to a repeater. the problem
I have a repeater object that displays a number of rows. I also have
I have a div which which displays dynamically created tables (In a asp.net repeater

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.