ASP.NET /JavaScript Problem - Image onload

J

John E

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top