我有一个在Asp中开发的Web应用程序。 net MVC3并且在我的localhost环境中运行良好,但是当我在线托管应用程序时,它在很多方面都会产生问题。
例如,我有一个名为费用提交的特定页面,当我尝试访问时,向我显示以下异常:
这是异常其余部分的图像
以下是我的控制器方法:
// GET: /FeeSubmission
public ActionResult FeeSubmission()
{
return View(niti.getStudentAndFeeDetails());
}
##
这里是getStudentAndFeeDetails()方法定义:
## public List<StudentFeeMapping> getStudentAndFeeDetails()
{
log.Info("FeeNiti :: getStudentAndFeeDetails : START");
var newlist = from n in _dataBase.studentfeemappings
select new StudentFeeMapping
{
AdmissionNumber = n.AdmissionNumber,
FatherName = n.studentrecord.guardianrecords.FirstOrDefault().FirstName,
Batch = n.studentrecord.classrecord.ClassName + "-" + n.studentrecord.classrecord.Section,
FeeName = n.feerecord.FeeName,
FeeAmount = n.feerecord.FeeAmount,
StudentName = n.studentrecord.FirstName,
StudentFeeMappingID = n.StudentFeeMappingID,
DiscountAmountinCurrency = (from feeCollectiondateData in _dataBase.feerecords
where (feeCollectiondateData.CategoryID == n.studentrecord.CategoryID && feeCollectiondateData.discounttype == "Currency")
select feeCollectiondateData.FeeAmount).FirstOrDefault(),
DiscountAmountinPercentage = (from feeCollectiondateData in _dataBase.feerecords
where (feeCollectiondateData.CategoryID == n.studentrecord.CategoryID && feeCollectiondateData.discounttype == "Percentge")
select feeCollectiondateData.FeeAmount).FirstOrDefault(),
FeeID = n.FeeID,
date = n.studentrecord.classrecord.feecollectionrecords.FirstOrDefault().StartDate
};
log.Info("FeeNiti :: getStudentAndFeeDetails : END");
return newlist.ToList();
} ##
这里需要注意的是,我有类似的控制器方法正常工作。我正在使用此方法操作来解决问题。