Posted on: 7/23/2013 6:44:41 PM | Views : 242

How can one pass fieldname at runtime?
Rather then specifying FieldName like PhoneNumber, I want to pass fieldName, so that same proc can be used for all.  I know I can do it using if but there are 25-30 fields are there on form, so I try to avoid that.
public ActionResult ListAccDtlAudit(int id, string field)            {                         List<tblAccountDetails_Audit> emodel = objEADR.GetAuditDetail(id);             var result = emodel.Select(c => c.PhoneNumber).ToList();             return Json(result, JsonRequestBehavior.AllowGet);         }

...

Go to the complete details ...