单击按钮时找不到的方法。 [英] Method not found on button click.

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

问题描述

我需要使用show确认消息。我从''btnCalculate''clientclick事件中调用该方法。如果这是第一次,它会调用该方法。但如果我第二次单击该按钮,则找不到该方法。下面是我的代码。请指教。非常感谢你..

< asp:按钮ID =btnYesrunat =serverOnClick =btnYes_Clicked/> 
< asp:Button ID =btnCalculaterunat =serverText =Calculate ClaimOnClientClick =return(cfrm());/>

函数cfrm(){
var consultFee =''0'';
consultFee = $(''[id $ = txtConsultFee]'')。val();

if(consultFee> 500){
if(confirm(''确认?'')){
$(''[id $ = btnYes]'') 。点击();
}
} else {
$(''[id $ = btnYes]'')。click();
}
返回false;
}

解决方案

(''[id


= txtConsultFee]'' ).VAL();

if(consultFee> 500){
if(confirm(''确认?'')){


(''[id

I need to use show the confirm message. I am calling the method from ''btnCalculate'' clientclick event. It calls the method if it''s the first time. but if i click the button the second time, the method is not found. below is my code. Please advice. Thank you so much..

<asp:Button ID="btnYes" runat="server" OnClick="btnYes_Clicked" />
<asp:Button ID="btnCalculate" runat="server" Text="Calculate Claim" OnClientClick="return(cfrm());"/>

function cfrm() {
        var  consultFee = ''0'';
        consultFee = $(''[id$=txtConsultFee]'').val();

        if (consultFee > 500) {
            if (confirm(''Confirm?'')) {
                $(''[id$=btnYes]'').click();
            }
        } else {
            $(''[id$=btnYes]'').click();
        }
        return false;
    }

解决方案

(''[id


=txtConsultFee]'').val(); if (consultFee > 500) { if (confirm(''Confirm?'')) {


(''[id


这篇关于单击按钮时找不到的方法。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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