示例#1
0
 protected void ddlObjectbind(int GroupId)
 {
     try{
         List <ObjectModel> li = OBJ.GetObjectsByGroupId(GroupId);
         if (li != null)
         {
             var list2 = li.Select(o => new { o.Name, o.ObjectID }).Distinct();
             BindingClass.BindDropDown(ddlObject, list2, "Name", "ObjectID", "Select Object");
         }
     }
     catch (Exception)
     { BindingClass.ExceptionAlertScriptManager(this.Page, this.GetType()); }
 }
        public void ddlobject(int GroupId)
        {
            List <ObjectModel> li = OBJ.GetObjectsByGroupId(GroupId);

            if (li != null)
            {
                var list = li.Select(o => new { o.Name, o.ObjectID });
                BindingClass.BindDropDown(ddlObject, list, "Name", "ObjectID", "Select Device");
            }
            else
            {
                BindingClass.ClearDropDown(ddlObject, "Select Device");
            }
        }
 public void ddlobject(int GroupId)
 {
     try
     {
         List <ObjectModel> li = OBJ.GetObjectsByGroupId(GroupId);
         if (li != null)
         {
             var list = li.Select(o => new { o.Name, o.ObjectID });
             BindingClass.BindDropDown(ddlObject, list, "Name", "ObjectID", "Select Device");
         }
         else
         {
             BindingClass.ClearDropDown(ddlObject, "Select Device");
         }
     }
     catch (Exception)
     { BindingClass.ExceptionAlertScriptManager(this.Page, this.GetType()); }
 }