简体   繁体   中英

Client side events for Asp.net controls

I have image as below

<asp:Image runat="server" ID="imgLogo" Style="border-width: 0px; max-width: 100%; max-height: 200px;" onerror="showInvalidImageMessage();" onload="imageChanged()"/>

here I want to fire JavaScript event how ever it is looking for server side handler.

I can't use JQuery 's on or bind or live because these are not working in my scenario as this image control is coming dynamically.

Focusing on client side event we use onclientclick for ASP button in the same way I tried onclientload which doesn't work. I want to use pure JS . Possible?

The Image control lets you work with images from server code. Use the Image control to display any valid image supported by the requesting browser on the Web page.

The OnLoad attribute is used to add an event handler the Load event, which is a server side event, not client side.

refer this

OnLoad client event for Image control

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM