public ActionResult Index() { func func = new func(); var cs = Session["customers"]; if (cs == null) { return(RedirectToAction("LoginForm", "Admin")); } List <Product> lstpro = new List <Product>(); lstpro = func.getAllProducts(); ViewBag.categoryID = new SelectList(func.getAllCategories(), "ID", "cateName"); ViewBag.BrandID = new SelectList(func.getAllBrands(), "ID", "brandName"); return(View()); }