Take the 2-minute tour ×  I am using a LinqDataSource and a
FormView with paging enabled on an ASP.NET page. I am trying to
access the FormView's DataItem property on PageLoad and I have
no trouble on the first page load, but as soon as I use the
Next/Prev page button (causing a postback) on the FormView the
DataItem property is null, even if there a record showing in the
FormView. Any ideas why it works fine on the first page load but
not on a postback?  If you're curious what my PageLoad event
looks like, here it is:  protected void Page_Load(object sender,
EventArgs e)     Label lbl =
(Label)fvData.FindControl("AREALabel");     if (fvData.DataItem
!= null && lbl != null)         var area =
db.AREAs.SingleOrDefault(q => q.AREA1 == record.AREA);
if (area != null)             lbl.Text = area.AREA_NAME;
share|improve this question probably you have to rebind your
formview in page_index changing event –  Waqar Janjua Jul 18 '12
at 17:47 How can you rebind it if it's using data from a
LinqDataSource cont