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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:25:25+00:00 2026-06-01T01:25:25+00:00

I have Repeater Control and in that i have code like this <div runat=server

  • 0

I have Repeater Control and in that i have code like this

<div runat="server" id="divleft" onmouseover="this.style.background='#BADFCE';"    onmouseout="this.style.background='white';">
    <asp:LinkButton ID="lnkCategory" runat="server" Text='<%# Eval("CategoryDescription")%>'
        CommandArgument='<%# Eval("CourseLibraryCategoryID") %>' 
        OnClick="lnkCategory_Click"
        CssClass="courseLink">
    </asp:LinkButton>
    <asp:Label ID="lblCount" runat="server" Text=""></asp:Label>
</div>

Now i have to do that after Click on that LinkButton the background color of the div name ‘divleft’ has to be applied for that i code like this in .aspx.cs page……

 protected void lnkCategory_Click(object sender, EventArgs e)
 {
    LinkButton temp = (sender as LinkButton);
    temp.Attributes.Add("style", "color:green  !important;");
    (temp.NamingContainer.Controls[1] as System.Web.UI.HtmlControls.HtmlContainerControl).Attributes.Add("style", "background-color:#BADFCE !important;");
 }

Now this code is perfectly running in IE and Chrome but not working in Firefox.

  • 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-01T01:25:26+00:00Added an answer on June 1, 2026 at 1:25 am

    You shouldn’t need to use !important unless there is something wrong with your core CSS. If I were you, I would move the UI to a JavaScript layer.

    jQuery:

    jQuery('.courseLink').click( function(event) {
        event.preventDefault();
        jQuery('#divleft').css('background-color','#BADFCE');
        jQuery(this).css('color','green');
    } );
    

    Or Better Yet, something like this:

    jQuery('.courseLink').click( function(event) {
        event.preventDefault();
        jQuery('#divleft').addClass('active');
        jQuery(this).addClass('clicked');
    } );
    

    With (css):

    #divleft.active {
        background-color:#BADFCE;
    }
    .courseLink.clicked {
        color:green;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings! I have a Repeater control that's using an XmlDataSource control. <asp:FormView id=myFormView runat=server
I have Repeater Control as shown below. <asp:Repeater ID=rptCategory runat=server> <HeaderTemplate> <h2 class=art-logo-text style=margin-bottom:
I have a repeater control: <table style=width: 100%> <asp:Repeater runat=server ID=rptOptions OnItemDataBound=rptOptions_ItemDataBound> <HeaderTemplate> <tr>
I have a repeater that is looping a user control, like this: <asp:Repeater ID=repItems
I have a Repeater control in my aspx page: <asp:Repeater ID=repeater runat=server EnableViewState=false> <ItemTemplate>
I have a asp.net repeater control in a aspx page, with runat=server and an
I am annoyed with a problem I have repeater control in updatepanel like this.
I have a repeater control that contains an ItemTemplate containing a databound label and
I have a Repeater control that is being bound to the result of a
I have a Repeater control that loads instances of a custom control I have

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.