如何处理asp.net中的图像按钮控件 [英] how deal with image button control in asp.net

查看:66
本文介绍了如何处理asp.net中的图像按钮控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们!
完全是dotnet的初学者.我在图像按钮控制方面遇到了问题.
请尝试帮助我.
我的问题是:
我有一个图像按钮控件,为此控件我指定了图像URL,现在当用户在该图像的中心点上单击时,我想显示类似您赢了"的消息.如果用户单击中心位置以外的其他位置,则应该显示您迷路了".
请帮助我了解更多信息.
在此先谢谢您.

Hi friends!
am completely beginner for dotnet.i got a problem with image button control.
please try to help me out.
My problem is:
i have a image button control,for that control i specified image url,now i want to display a message like "you won" when user cliks on exactly center point of that image.if user clicks some where else other than center position it should display "you lossed".
Please help me to learn more.
Thanks in advance.

推荐答案

要使其在ASP.NET中有效,您需要使用JavaScript.

使用JavaScript,获取鼠标单击事件.它的坐标.
然后根据图像的高度,宽度和位置,获取中心点.根据click事件验证它并显示"win"或"lose"消息!
For this to work in ASP.NET, you need to use JavaScript.

Using JavaScript, get the mouse click event. It''s coordinates.
Then based on the Image height, width and the location, get the center point. Based on the click event verify it and show the ''win'' or ''lose'' message!


这篇关于如何处理asp.net中的图像按钮控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆