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 9075737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:56:01+00:00 2026-06-16T18:56:01+00:00

Introduction : I have a repeater with linkbuttons, and when I click on some

  • 0

Introduction:

I have a repeater with linkbuttons, and when I click on some button, I want it and only it to become transparent, and that the rest of the buttons wouldn’t change.

D-Tails:

I have a Repeater of LinkButtons:

<div style="position: relative">
<asp:Repeater runat="server" ID="repStatuses" 
        onitemdatabound="repStatuses_ItemDataBound"
        onitemcommand="repStatuses_ItemCommand">
  <ItemTemplate>
        <div id="divLinkBtn" style="display:inline"><asp:LinkButton ID="linkBtnStatuses" runat="server" CommandName="ShowText" 
            CommandArgument='<%# Eval("Priority") + ";" + Eval("LevelID") + ";" + Eval("ID") %>'
            OnClientClick='<%# "MyFunc(" + Eval("Priority") + ");" %>'>
            <div runat="server" id="divSts" class="fontAriel" ></div>
        </asp:LinkButton></div>
  </ItemTemplate>
    </asp:Repeater>
</div>

The LinkButtons fade in on Page_Load using the following Jquery function.
Here’s the Page_Load and the jquery code:

Page_Load:

protected void Page_Load(object sender, EventArgs e)
{
    SetPageTitle();

    if (!Page.IsPostBack)
    {
        LoadStatusesAndButtons();

        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "tmp", "<script type='text/javascript'>LoadBarWithFadeIN();</script>", false);
    }

    else
        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "tmp", "<script type='text/javascript'>LoadBar();</script>", false);

}

Jquery

function LoadBarWithFadeIN() {
$(document).ready(function () {

    $('a[id*="repStatuses"]').each(function () {
        $(this).show(2500);
        $(this).delay(1000);
    });
});

}

function LoadBar() {
$(document).ready(function () {

    $('a[id*="repStatuses"]').each(function () {
        $(this).show(0);

    });
});

}

When I click on some LinkButton, it becomes Transparent.
I found that this code makes only the first linkButtons transparent:

  $(document).ready(function () {
  $('#divLinkBtn').click(function () {
      alert('divlinkbutton presed');
      $(this).css({ 'opacity': 0.4 });
  });
});

THE PROBLEM IS that the button becomes transparent for a second and then the page loads the LoadBar() function and the transparency dissapears.
Another thing is that this function does not handle the rest of the buttons.

Now what I need is that this LinkButton should stay transparent until I click on some other linkbutton.

I was thinking of a way to load all the unclicked buttons as is and somehow load the specific clicked button with the trancparency but I can’t find a way of doing this due to lack of coding experience.

Sorry for the “short” post 🙂

Any help’d be much appreciated!!!!!

  • 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-16T18:56:05+00:00Added an answer on June 16, 2026 at 6:56 pm

    After a good night sleep, here’s a simple (not the most elegant though) solution:

     protected void repStatuses_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
       SetAsOriginal();
    
        //Get the linkbutton that was clicked
        LinkButton lnkBtnClicked = e.CommandSource as LinkButton;       //e- is the object of the repeater. CommandSource- is the clicked
        if (lnkBtnClicked != null)
        {
            SetOpacity(lnkBtnClicked, "0.4");
        }
    
    private void SetAsOriginal()
    {
        foreach (RepeaterItem item in repStatuses.Items)
        {
            LinkButton btn = item.FindControl("linkBtnStatuses") as LinkButton;
            SetOpacity(btn, "1.0");
        }
    }
    
    private void SetOpacity(LinkButton linkButton, string opacityValue)         //SET THE OPACITY TO THE SPECIFIC linkbutton 
    {
        linkButton.Style.Add("opacity", opacityValue);
    }
    

    The thing is, that the answer above was very good and working, but did not answer my demand.. I needed to set only the clicked button as transparent and the rest of the buttons are to be set back to original.

    So I’ve decided to specify the solution for those who might encounter with similar issue.

    thank you everyone.

    P.s: special thanks to @Lukasz M

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

Sidebar

Related Questions

Introduction I have some sort of values that I might want to access several
Introduction I have a ListView and want to format only the second column. The
Introduction I have a app that has multiple tables, some with and some without
Introduction I have been so annoyed by applications that have a startup dialog which
i seem to have some trouble installing autopy.h https://github.com/msanders/autopy/#introduction i already tried the installation
Just an introduction of my code... I have a view that consists of -details
Introduction: I have a grid with a Field Called Value and that field could
INTRODUCTION : I have a function(callback) that receives a object as an argument, inside
Brief introduction: I have this ASP.NET Webforms site with the particularity that it doesn't
Fibonacci numbers have become a popular introduction to recursion for Computer Science students and

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.