I have a strange problem. I have ascx control and I have only ListView in it. When I use generic method to fill this ListView with data I get Exceptiion - ListView is null. But when I use method without generics(with known parameter) everything is working fine(ListView is not null). Could you explain me why something like this is happening?
this works fine:
public void SetListViewDataSource(List<BaseBO> data)
{
this.ListView.DataSource = data;
this.ListView.DataBind();
}
and this is not working:
public void SetListViewDataSource<T>(List<T> data) where T : BaseBO, new()
{
this.ListView.DataSource = data;
this.ListView.DataBind();
}
I am using Model-View-Presenter pattern