ASP.NET图像单击事件 [英] ASP.NET Image Click Event

查看:178
本文介绍了ASP.NET图像单击事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个想要单击并执行代码而不重定向页面的图像.我已经看到人们在哪里使用ImageButton了,但这不符合我的需求.由于某种原因,该代码将执行两次.我使用了Page.IsPostBack,它仍然两次击中代码.

设计器页面代码

I have an image that I want to click and execute code without redirecting the page. I have seen where people have used ImageButton, but this does not suit my needs. For some reason, the code gets executed twice. I used Page.IsPostBack and it still hits the code twice.

Designer Page Code

<asp:ImageButton ID="ibShow" runat="server" ImageUrl="~/images/collapse.gif" OnClick="ibShow_Click"/>

推荐答案

如果这是asp.net问题,请尝试以下方法以获得更好的支持.


http://www.asp.net/
if this is an asp.net question, try the following for better support.


http://www.asp.net/


这篇关于ASP.NET图像单击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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