My application developed in mvc 3 + razor , I have two page add detail and edit detail , and a button named Estimation on both page , When i click on the button i open a model jquery popup of Estimation form.
Estimation page having a dropdown of year's when i select year i populate all rates by following script.
<script type ="text/javascript">
$(function () {
$('#RatePeriodid').change(function () {
var selectedValue = $(this).val();
$.ajax({
type: "POST",
url: '../WebServices/AddSOP.asmx/PopulateEstimationRates',
data: "{Period_id:'" + selectedValue + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
success: function (msg) {
var data = msg.d;
$('#Standerd_Weekday_Rate').val(data.Standerd_Weekday_Rate);
.................................
and so on
},
error: function (msg) {
alert("Error");
}
});
});
});
</script>
My problem is when i open popup from add detail page all things are working fine , but when i open popup from edit detail page , and select an year from dropdown my ajex script giving error message. And my web service (../WebServices/AddSOP.asmx/PopulateEstimationRates) not calling .
What is the wrong with my code ?