按钮点击代码不起作用 [英] Button click code is not working

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

问题描述

在OnOnClickClicked按钮中,以下调用简单的jquery,以获取来自用户的确认消息.如果用户按是",则应该执行按钮单击事件,但没有这样做.

我的Java脚本代码:


In Button OnClientClicked am calling simple jquery following, for conformation message from user. If user press yes then it should do button click event, but it is not doing.

My java script Code:


function OnClientClicked_CheckConfirm(button, args) 
{
    var objhidConfirmMessage = document.getElementById(hidConfirmMessage);
    var objhidConfirmOKBtnText = document.getElementById(hidConfirmOKBtnText);
    var objhidConfirmCANCELBtnText = document.getElementById(hidConfirmCANCELBtnText);
    if (objhidConfirmMessage != null) 
    {
        button.set_autoPostBack(false);
        jConfirm(objhidConfirmMessage.value, 'Confirmation Dialog', objhidConfirmOKBtnText.value, objhidConfirmCANCELBtnText.value, function (r) {
            if (r) {
                __doPostBack(button.get_id(), "");
                blnConfirm = true;
            }
        });
    }



按钮源代码



button source code

<telerik:RadButton ID="tlkBtnQuickFormatCaptureDrive" runat="server" SkinID="btnGeneral"

                            OnClientLoad="OnClientLoad_HideTlkBtnToolTip" OnClientClicked="OnClientClicked_CheckConfirm" OnClick="OntlkBtnQuickFormatCaptureDrive_Click">
                            </telerik:RadButton>



我是否在__doPostBack()中缺少任何内容.

需要在pageload()中调用按钮单击事件.

请帮帮我.



Am I missing any thing in __doPostBack().

Needs to call button click event in pageload().

please help me.

推荐答案

使用属性AutoPostBack ="true"
use the attribute AutoPostBack="true"


只需设置AutopostBack = true.您的代码无法正常工作的原因.
just set AutopostBack=true..i think thats the reason your code is not working..


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

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