9
Answers

Data Binding error

Hello Team, I tried binding these tables together and this is the error mesage that came in the screenshot below

 

 public JsonResult UpdateItem(int? ItemId)
        {
            var dataList = objRestaurantDBEntities.tblItems.Include("tblCategory").Include("tblQuantity").ToList();
            var modifiedData = dataList.AsEnumerable().Where(x => x.ItemId == ItemId).Select(d => new bindItem
                {

                    ItemId = d.ItemId,
                    CategoryId = d.CategoryId,
                    PCode = d.PCode,
                    CategoryName = d.tblCategory.CategoryName,
                    QuantityId = d.QuantityId,
                    Quantity = d.tblQuantities.Quantity,
                    ItemName = d.ItemName,
                    ItemPrice = d.ItemPrice,
                    Active = d.Active
                }).FirstOrDefault();
            return Json(modifiedData, JsonRequestBehavior.AllowGet); 
        

        }

 

 

Answers (9)
0
Sanjeeb Lenka

Sanjeeb Lenka

NA 15.3k 2.4m 9y
try this method.
 

function myFunction() {
var pass1 = document.getElementById("pass1").value;
var pass2 = document.getElementById("pass2").value;
var ok = true;
if (pass1 != pass2) {
//alert("Passwords Do not match");
document.getElementById("pass1").style.borderColor = "#E34234";
document.getElementById("pass2").style.borderColor = "#E34234";
ok = false;
}
else {
alert("Passwords Match!!!");
}
return ok;
}

call it on client click
 
or
 
check this link for sample 
 
 http://www.articlemirror.in/2013/06/how-to-compare-password-and-confirm.html