Hi guys, I have a form with button "Select All Emails". Now the problem I have if I click the button it will display all emails in that "ContactEmail" field from the database, if there is no email created it will show "NULL". Now what I want is not to show anything if the field is null (no email created). Below my controller code;
public JsonResult GetAllUser(EmployeeModel objModelMail, string to)
{
List Recyclers = new List();
{
List
using (WasteRecyclersEntities db = new WasteRecyclersEntities())
{
var query = from q in db.Recyclers
select q.ContactEmail;
return new JsonResult { Data = query.ToList(), JsonRequestBehavior = JsonRequestBehavior.AllowGet };
}
{
var query = from q in db.Recyclers
select q.ContactEmail;
return new JsonResult { Data = query.ToList(), JsonRequestBehavior = JsonRequestBehavior.AllowGet };
}
}

Mangesh GRank #294 · 8.6K reputationPosted Feb 19, 2018, 1:37 AM EST
Mangesh GRank #294 · 8.6K reputationPosted Feb 19, 2018, 12:16 AM EST
Dharmraj ThakurRank #577 · 4.2K reputationPosted Feb 19, 2018, 1:03 AM EST
Mangesh GRank #294 · 8.6K reputationPosted Feb 19, 2018, 1:42 AM EST
Mangesh GRank #294 · 8.6K reputationPosted Feb 19, 2018, 1:47 AM EST
Attie103 reputationPosted Feb 19, 2018, 1:31 AM EST
Attie103 reputationPosted Feb 19, 2018, 1:42 AM EST
Mangesh and Dharmraj
Attie103 reputationPosted Feb 19, 2018, 1:46 AM EST