I have the below code which works fine(pulls record from databse)
but when the datasource is assigned to ListView1 the records are not populated in the ListView upon page Load
however the same code works fine(the records get populated upon page load) when i replace the ListView with Repeater in the aspx page and assign the data to Repeater1
private async Task<IQueryable<ME_Posts>> GetAllPosts(string locale, MediaEntities context)
{
return (from set in context.ME_Posts where set.Hide == false && set.ParentPostID == null && set.Locale == locale select set);
}
private async Task PopulateAllPosts(string locale, MediaEntities context)
{
ListView1.DataSource = await GetAllPosts(locale, context).Result.ToListAsync();
ListView1.DataBind();
}
Go to the complete details ...