首次单击时,图像按钮单击事件不起作用。 [英] Image button click event is not working at first click.

查看:81
本文介绍了首次单击时,图像按钮单击事件不起作用。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个项目,我在其中添加了一个图像按钮和母版页上的一些链接按钮。

图像按钮点击事件我编码链接按钮显示/隐藏。

运行项目后,默认值按定义加载,但是当我单击图像按钮时,页面关联它的postbackurl属性已成功加载但链接按钮无效。在第二次单击该图像按钮后,它将触发onclick事件。



i使用按钮控件而不是图像按钮,但没有chnage。



任何人都可以解决这个问题。

请帮助。

I am working on a project in which i add a image button and some link button on master page.
on imagebutton click event i coded for link button show/hide.
after running the project the default value are loaded as defined, but when i click the imagebutton then the page associate with it's postbackurl property is successfully loaded but link button has no effect. after second click on that imagebutton it will fire the onclick event.

i use button control instead of imagebutton, but there is no chnage.

Can any one solve this problem.
Please help.

推荐答案

最可能的原因是你在事件中翻转您的值,并在页面加载中设置它。页面加载首先激活,这会产生滞后,将页面加载代码移动到页面预渲染,订单将是正确的。



阅读如何使用调试器,你没有它就无法编码。
The most likely reason is that you flip your value in an event, and set it in page load. Page load fires first, which creates the lag, move your page load code to page prerender and the order will be correct.

Read on how to use your debugger, you can't code without it.


这篇关于首次单击时,图像按钮单击事件不起作用。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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