Client-side OnLoad on asp:image

D

Daisy

Is there any way in an ascx (without resorting to a codebehind file) to have
a client-side onload event on an asp:image tag?

I've just changed from a normal image, to an asp:image tag, but now it tries
to interpret my javascript server-side :-\

<asp:Image runat="server" ImageUrl="a"
onload="LoadImage(this);"></asp:Image>

:-((
 
S

Shiv Kumar

Daisy,

first, unless you need access to your image tag in code, there is no need to
use an asp:image tag.
What is the problem you're having exactly? Why is your page processing the
JavaScript on the server? Do you have the runat attribute set to server in
your <script> tag for client side scripts?

Have you tried using a script file instead of having the script in line?
I've not had this problem even thou I've used this in some of my pages.

finally, the aspnet group might be a better place to ask this question.
 

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

Top