onclient单击不起作用 [英] onclient click not working

查看:99
本文介绍了onclient单击不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此"onclick"中有效,但未调用javascript函数.请帮助如何同时执行onclick和onclientclick.

In this "onclick" is working but it is not calling javascript function.please help how to execute both onclick and onclientclick at the same time.

<asp:Button ID="btnFare"  OnClientClick="return initialize();"  runat="server"  Text="Calculate Fare" onclick="btnFare_Click"/>
please suggest solution of this problem.



在此先感谢



Thanks in advance

推荐答案


看看这个:
http://forums.asp.net/t/1627090.aspx [
Hi,
Take a look at this:
http://forums.asp.net/t/1627090.aspx[^]

I hope it helps


不可能同时调用两个click事件.在这里,将执行第一个客户端onclick(OnClientClick),javascript的返回也会对其产生影响.如果从javascript返回的类型为false,则不会执行"onclick"事件.因此,请检查javascript返回true,以便执行服务器的返回单击(onclick).
Its not possible to call both the click event at same time . Here 1st client onclick will be executed (OnClientClick) the return of javascript also effects on it . If the return type is false from the javascript then the "onclick" event does not execute it .So check weather the javascript returns true in order to execute the server return click (onclick).


首先调用OnClientClick点击,如果返回true,则调用OnClick.

如果要在OnClieck调用后从OnClientClick事件中获取数据,则将数据存储到hiddent字段中并在OnClick事件中呈现它,然后再在OnClick Server边事件中显示它.

希望它对您有用.
OnClientClick click is called first and if it return true than OnClick is called.

if you want data from OnClientClick event after OnClieck is called than store your Data into hiddent field and render it on OnClick event than again Display it in OnClick Server side event.

Hope it will work for you.


这篇关于onclient单击不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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