(mvc 3 + razor)应用程序中的问题 [英] Problem in (mvc 3 + razor ) application
问题描述
我的应用程序是在mvc 3 + razor中开发的,我有两页用于添加细节和编辑细节,并且在两页上都有一个名为Estimation的按钮,当我单击该按钮时,我会打开一个Estimation表单的模型jquery弹出窗口. >
当我选择年份时,估算页面的年份会下降,我会通过以下脚本填充所有费率.
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>
我的问题是,当我从添加详细信息页面打开弹出窗口时,一切正常,但是当我从编辑详细信息页面打开弹出窗口,并从下拉列表中选择一年时,我的ajex脚本给出了错误消息.而且我的Web服务(../WebServices/AddSOP.asmx/PopulateEstimationRates)没有调用.
我的代码有什么问题?
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 ?
推荐答案
( function (){
(' #RatePeriodid').change( var selectedValue =
('#RatePeriodid').change(function () { var selectedValue =
( this ).val();
这篇关于(mvc 3 + razor)应用程序中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!