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
- int LoanId;
- using (TempoDevRM01Entities borrowerDBEntity = new TempoDevRM01Entities())
- {
- LoanId = borrowerDBEntity.ReferralDetails.Where(x => x.LoanNo == LoanNo).Select(x => x.LoanID).FirstOrDefault();
-
- int hardshipcount=borrowerDBEntity.HardshipDiscoveries.Where(x=>x.LoanID==LoanId).Select(x=>x.HardshipDiscoveryID).Count();
- return hardshipcount;
- }
#view code
- var hardshipid =parseInt( @ViewBag.HardshipCount);
- if (hardshipid < 1) {
- debugger;
- $("#panel3").attr("disabled", "disabled");
- $("#panel3").css('cursor', 'not-allowed');
- }
- else {
- $("#reviewsubmit").removeAttr("disabled");
- $("#panel3").css('cursor', 'POINTER');
- }
but it shows NAN value in locals is anythigng wrong with these things?