Why is my handler being called multiple times?
<p>I have this that is called when I drop something in my calendar and it shows a scheduling dialog, when I press a button on that dialog, it makes an ajax call.</p>

<p>I am noticing that the first time I click it, 1 ajax call is made, next press, 2 ajax calls, and so forth.</p>

<p>I only ever want 1 handler for the btnSchedule:</p>

<p>see:</p>

<pre><code>  $('#btnSchedule').on('click', function () {
</code></pre>

<p>.</p>

<pre><code> drop: function(date, allDay, ev, ui, resource) { // this function is called when something is dropped

                    // retrieve the dropped element's stored Event Object
                    var originalEventObject = $(this).data('eventObject');

                    // we need to copy it, so that multiple events don't have a reference to the same object
                    var event = $.extend({}, originalEventObject);

                    var obj = this;

                    var hours = 1;

                    var id = event.id;
                    var type = event.type;


                   $('#txtFrom').change(function () {
                       $('#txtHours').val('');
                       fillPriorityList("#&lt;%= ddlPriority.ClientID %&gt;",type + id,resource.id,$('#txtFrom').val());
                    });
                    showScheduler(
                        event.title,
                        $.fullCalendar.formatDate(date,'dddd MMMM dd yyyy'),
                        $.fullCalendar.formatDate(date, 'MM/dd/yyyy'),
                        event.canReoccur,event.reoccurVal,"#&lt;%= ddlPeriod.ClientID %&gt;",
                        "#&lt;%= cbPeriod.ClientID %&gt;");

                    fillPriorityList("#&lt;%= ddlPriority.ClientID %&gt;",type + id,resource.id,$('#txtFrom').val());


                    $('#btnSchedule').on('click', function () {
                        var hrs = $('#txtHours').val();
                        var usingHrs = (isNaN(hrs) == false &amp;&amp; hrs &gt; 0);
                        var usingRange = isDateRangeValid('#txtFrom','#txtTo');
                        var canRec = event.canReoccur;
                        var periodChecked = $("#&lt;%= cbPeriod.ClientID %&gt;").prop('checked');
                        var recVal = $("#&lt;%= ddlPeriod.ClientID %&gt;").prop('selectedIndex');
                        var priority = $("#&lt;%= ddlPriority.ClientID %&gt;").val();

                        if(usingHrs || usingRange)
                        {
                            var  f = $.datepicker.parseDate('m/d/yy', $('#txtFrom').val());
                            var  t = $.datepicker.parseDate('m/d/yy', $('#txtTo').val());
                            var correctStart = usingHrs ? date : f;
                            $.ajax({
                                type: "POST",
                                url: "CalendarServices.aspx/RegisterEvent",
                                data: 'id=' + id + '&amp;start=' + $.fullCalendar.formatDate(correctStart, 'yyyy-MM-dd')
                                    + '&amp;end=' + $.fullCalendar.formatDate(t, 'yyyy-MM-dd') + '&amp;type=' + type + '&amp;hours=' + hrs + '&amp;resource=' + resource.id
                                 + '&amp;canRec=' +  canRec + '&amp;periodChecked=' + periodChecked + '&amp;recVal=' + recVal + '&amp;priority=' + priority,

                                success: function (data) {
                                    $(obj).remove();
                                    changeUnscheduledHeaders();
                                    closeScheduler();                              
                                    $('#calendar').fullCalendar('refetchEvents');
                                }
   ,
                                error: function () {
                                }
                            });
                        }

                    })


                }

                ,
</code></pre>

<p>What can I do so that it only ever calls my ajax once?</p>

<p>Thanks</p>
