ASP.NET /JavaScript Problem - Image onload

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John E

    #1

    ASP.NET /JavaScript Problem - Image onload

    I have created an ASP.NET user control (.ascx) which controls whether to
    show or hide a bunch of divs on my page. This event is controlled through
    the onlclick event of an image (with each ASCX). The hiding and showing
    works part works fine.

    What I can't get to work is the initialisation of each separate div/control.
    My initial thoughts were to use the onload event of each image, but I can't
    seem to get it to fire.

    The image HTML tag in the .NET user control is:

    <img src="e.gif" id="expand" onclick="expand _div(<%=_expand _div_id%>,
    this);" onload="Test(); " />

    The onload attribute seems to do absolutely nothing. I've tried it without
    empty parenthesis at the end but it makes no difference.

    How do I get the onload event in the image to work so that it initialises
    each div?


Working...