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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:21:07+00:00 2026-05-15T23:21:07+00:00

I am trying to use the onmouseover and onmouseout event on a table td

  • 0

I am trying to use the onmouseover and onmouseout event on a table td created on the client side, so that when the a user mouses over the table cell, a panel becomes visible, and when they mouse out, the panel becomes invisible.

<table>
    <tr>
        <td onmouseover="ToggleVisibility('FileHeader', true);" onmouseout="ToggleVisibility('FileHeader', false);">
            Some content goes here.                         
        </td>
    </tr>
</table>

The onmouseover and onmouseout call the following JavaScript function, also defined on the client side.

<script language="javascript" type="text/javascript">
    function ToggleVisibility(id, visible) {
        var content = document.getElementById(id);
        if (content != null) {
            if (visible) {
                content.style.display = "block";
            } else {
                content.style.display = "none";
            }
        }
    }
</script>

The "id" that I’m passing in to getElementByID is the id for a Panel control created in code behind during Page_Load. The Panel is added to a different table that is defined on the client side like so:

<asp:Table ID="HelpTable" runat="server"></asp:Table>

Here is the panel created and added to the table in code behind:

TableRow row = new TableRow();
HelpTable.Rows.Add(row);
TableCell cell = new TableCell();
row.Cells.Add(cell);

Panel pFileHeader = new Panel();
pFileHeader.ID = "FileHeader";
pFileHeader.Style.Add("Display", "none");

cell.Controls.Add(pFileHeader);

(The panel, pFileHeader contains actual content (labels with text, etc.) that I’ve left out for simplicity).

When this Panel is created on the client side, my ToggleVisibility function works fine, but when the Panel is created in code behind, getElementById returns null. I’m pretty new to JavaScript, and would appreciate any help.

  • 1 1 Answer
  • 2 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-15T23:21:07+00:00Added an answer on May 15, 2026 at 11:21 pm

    Asp.net will automatically name mangle all of the id’s of you runat=server objects. You can retrieve the mangled ID using the clientId property.

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

Sidebar

Related Questions

I'm trying use eco for client-side templating. I have multiple .eco templates that I'd
Trying to use code from here Im trying to incorporate both classes so that
I'm trying to use jQuery to insert HTML into a table element. I've been
I am trying to use the .tooltip() that I found from the following: Jquery-ui
I'm trying to draw a single line using OnMouseMove() event. My Problem is that
I am trying use an if statement and TWO .addClass background-color variables based on
I was trying use svn to find a checkin using svn log, but it
I was trying use a set of filter functions to run the appropriate routine,
I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The

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.