Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How do i use the lost focus,mouse over etc event
Posted

Take a look at the focusout[^] and blur[^] events.

To use ajax in JQuery, use $.ajax[^].
 
Share this answer
 
Try this

JavaScript
<script>
    
    var _url = '@Url.Action("ControllerName", "ActionName")'; // url of the action
    var _parameters = {parameterName: "somevalue"};

    $.ajax({
        type: "POST",
        url: _url,
        contentType: "application/json; charset=utf-8",
        data: _parameters,
        dataType: "json",
        success: function (data) {
            // data - contains the return value from the action
            alert('Success');
        },
        error: function (data) {
            // data - contains the stack trace for the error
            alert('failure');
        }
    });


</script>


for events refer this Events[^]
 
Share this answer
 

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