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

  • Home
  • SEARCH
  • 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 3960526
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:51:52+00:00 2026-05-20T02:51:52+00:00

I have a repeater containing several several panels. I have noticed that there is

  • 0

I have a repeater containing several several panels.
I have noticed that there is no onmouseover attribute of the <asp:Panel>.
I have read that I can add the attribute to the panel by calling in the page_load:

PanelID.Attributes.Add("onmouseover", "Script to Run");

The problem is that I am in a repeater, and the PanelID is generated by asp.net like ContentPlaceHolder_ctl01_myID_0 so not only it is hard to figure out, but VS2010 does not recognise it as a proper object and throws an error on it, plus I have to attach it on every item, so I need to use a for or foreach, but I don’t know what to iterate on.
Is there a way like

foreach(childcontrol in Repeater.ChildControlsISpecificallyNeedPossiblyIdentifiedBySomeID)
{
 childcontrol.Attributes.Add("onmouseover", "Script to Run");
}

to do this in C# in the Page_Load eventhandler?
I want to run a client side onload, onmouseclick and onmouseout on the panels too, so I want to attach those attributes too.

  • 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-05-20T02:51:53+00:00Added an answer on May 20, 2026 at 2:51 am

    Thinking outside the box, instead of specifying the onmouseover-attribute inline using ASP.NET, you can attach the javascript event listeners in javascript.

    Give the panel a CSS class:

    <asp:Panel CssClass="panel"></asp:Panel>
    

    Using jQuery, the syntax to bind the event handlers would be as follows:

    $(".panel").mouseover(functionToRun);
    

    If you’re not using jQuery, you’ll need a bit more code, but I’m sure you get the idea.

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

Sidebar

Related Questions

I have several UserControls in an ASP:Repeater. They are 'Add to basket' User Controls
I have a repeater control that contains an ItemTemplate containing a databound label and
i have a repeater that will output a series of items: <asp:repeater ... runat=Server>
I have a ASP.NET 3.5 page which has a repeater containing lines of information
I have a repeater that displays some data from a SQL query: <asp:Repeater runat=server
i have a series of rows that are generated using an asp:repeater : <asp:repeater
I have a Repeater bound from SQL, containing a mixture of editable and read-only
I have two repeater which are nested..Means there is one repeater and inside that
I have a repeater containing, amongst others, two buttons. One of the buttons is
I have Repeater Control and in that i have code like this <div runat=server

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.