-2

I have to call the ajax function to reset the flag in database on the browser close event.

I am doing so for the prevent the multiple log in for that I have set the flag on log in event but I have to reset it on browser close event so I have to do it by ajax function but I am new to to so please guide me to call ajax function.

I have refereed the que

Community
  • 1
  • 1
Rhushikesh
  • 3,630
  • 8
  • 45
  • 82
  • How are you exposing your functions? If you want to make an AJAX call, you need to call a webmethod or a controller action from web api AFAIK. – tranceporter Sep 24 '13 at 12:02
  • I generally find this useful for people new to this site: http://msmvps.com/blogs/jon_skeet/archive/2009/02/17/answering-technical-questions-helpfully.aspx – Mark Schultheiss Sep 24 '13 at 12:14

1 Answers1

4

This is how you can make an ajax request to your server to reset database flag.

$.ajax({
        url: your url,
        type: "POST",
        data: {
            Flag: value
        },
        error: function () { alert("Unexpected Error"); },
        success: function (data) {

        }
    });
Jitendra Pancholi
  • 7,897
  • 12
  • 51
  • 84