crated method for inventorypage.cs