mvc中找不到函数错误 [英] Function not found error in mvc

查看:72
本文介绍了mvc中找不到函数错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





找不到功能错误



cshtml脚本





function not found error

cshtml script

<script>
    function ABC() {
        var email = $('#Email').val();
        //alert(email);
        $.ajax({
            url: 'person/CheckEmail',
            type: 'GET',
            data: 'email='+ email,//{email:email},         /*'id="' + email+'",*/
            cache: false,
            success: function (html) {
                alert(html);
            }
        });   
    }
</script>



我的控制器名称是personController

< br $>
控制器功能




my controller name is personController

controller function

public string CheckEmail(string email)
       {
           string show = "hi";
           return show;
       }





请帮帮我...



问候

AR



please help me...

Regards
AR

推荐答案

' #电子邮件')VAL();
// alert(email);
('#Email').val(); //alert(email);


.ajax({
url:' person / CheckEmail'
类型: ' GET'
data:' email =' +电子邮件, // { email:email},/ *'id ='+ email +',* /
cache: false
成功: function (html){
alert(html);
}
});
}
< / 脚本 >
.ajax({ url: 'person/CheckEmail', type: 'GET', data: 'email='+ email,//{email:email}, /*'id="' + email+'",*/ cache: false, success: function (html) { alert(html); } }); } </script>



我的控制器名称是personController

< br $>
控制器功能




my controller name is personController

controller function

public string CheckEmail(string email)
       {
           string show = "hi";
           return show;
       }





请帮帮我...



问候

AR



please help me...

Regards
AR


修改以下代码行:

Modify the following line of code:
url: '/person/CheckEmail',



将/放入你的网址。


put the "/" in your url.


这篇关于mvc中找不到函数错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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