namespace CookWithoutBookProject.Pages.Accounts.Admin
{
public partial class WebForm1 : System.Web.UI.Page
{
List<Classes.Entities.Ingridient> listIngridients;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
listIngridients = new List<Classes.Entities.Ingridient>();
}
}
protected void btnAddIngridient_Click(object sender, EventArgs e)
{
listIngridients.Add(ingridientObj);
}
}
}
When I run it I have a null reference exception , the listIngridients is not initialized
Go to the complete details ...