public void bindCheckBox() { SeedAction objSeed = new SeedAction(); IList<Category> category; category = objSeed.GetAllCategories(); string ids = string.Empty; foreach (Category sc in category) { if (ids.Length > 0) { ids = ids + "," + sc.id; } else { ids = sc.id.ToString(); } } ViewData["ids"] = ids; ViewData["categoryId"] = category; }
public void bindCheckBox(string seedId) { #region SeedAction objSeed = new SeedAction(); IList<Category> category; IList<Category> scategory; category = objSeed.GetAllCategories(); string ids = string.Empty; foreach (Category sc in category) { if (ids.Length > 0) { ids = ids + "," + sc.id; } else { ids = sc.id.ToString(); } } ViewData["ids"] = ids; ViewData["categoryId"] = category; if (seedId != null) { scategory = objSeed.GetCategoryBySeedID(seedId); ViewData["selectCategoryId"] = scategory; } #endregion }