i know how to make a mouse over event using html code and javascript
but
i tried using the attribute.add for label, but doesnot work
please do provide code examples
thankyou
Note that C#/VB.Net code executes on the server, before the actual page is sent down to the client browser. Once the page is sent, the only way to trigger C# code execution is for the client browser to make an HTTP request to the server.
By default the browser does not make HTTP requests on mouse events. Thus, the only way you can handle the mouse events is to have a client-side JavaScript code attached to the HTML element. That JavaScript code could execute an HTTP request (preferably AJAX) and pass the details about the mouse event to the server-side C# code, but if you take this route, please consider that network requests may result in battery power consumption and in charges for the user (if the user is on a metered cell network).
Of course, nothing prevents the C# code from generating the proper HTML element and corresponding JavaScript and sending them as part of the page down to the client, thus saving you at least writing the JS code to execute on page load.
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.