sangeetha k

sangeetha k

  • NA
  • 207
  • 48.9k

passing data from controller to view is showing NAN value

Apr 30 2018 4:51 AM
i wish to fetch the count of the row in table using which i wish to restrict the display of the panel inside the page using jquery .
here goes the #dal layer code
  1. int LoanId;  
  2. using (TempoDevRM01Entities borrowerDBEntity = new TempoDevRM01Entities())  
  3. {  
  4. LoanId = borrowerDBEntity.ReferralDetails.Where(x => x.LoanNo == LoanNo).Select(x => x.LoanID).FirstOrDefault();  
  5. //LoanId= GetLoanId(LoanNo);  
  6. int hardshipcount=borrowerDBEntity.HardshipDiscoveries.Where(x=>x.LoanID==LoanId).Select(x=>x.HardshipDiscoveryID).Count();  
  7. return hardshipcount;  
  8. }  
#view code
  1. var hardshipid =parseInt( @ViewBag.HardshipCount);  
  2. if (hardshipid < 1) {  
  3. debugger;  
  4. $("#panel3").attr("disabled""disabled");  
  5. $("#panel3").css('cursor''not-allowed');  
  6. }  
  7. else {  
  8. $("#reviewsubmit").removeAttr("disabled");  
  9. $("#panel3").css('cursor''POINTER');  
  10. }  
but it shows NAN value in locals is anythigng wrong with these things?

Answers (2)