Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

function not found error

cshtml script

HTML
<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>

my controller name is personController

controller function

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


please help me...

Regards
AR
Posted
Updated 7-Mar-14 21:45pm
v3

1 solution

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

put the ”/” in your url.
 
Share this answer
 
v3
Comments
An@nd Rajan10 8-Mar-14 3:43am    
person is my controller name
so i thing that not a problem
and also i am using the slash (/) ...
An@nd Rajan10 8-Mar-14 3:47am    
/ on front of the url ok got it...

An@nd Rajan10 8-Mar-14 3:47am    
thank you its works...
Snesh Prajapati 8-Mar-14 3:52am    
put the "/" before your controller name. I used your code and it is working fine.
Snesh Prajapati 8-Mar-14 3:53am    
Thx for confirmation..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900